Omega Owners Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Search the maintenance guides for answers to 99.999% of Omega questions

Pages: [1]   Go Down

Author Topic: Any Excel experts out there?  (Read 1552 times)

0 Members and 1 Guest are viewing this topic.

Nickbat

  • Guest
Any Excel experts out there?
« on: 04 September 2007, 21:05:49 »

I can't get my head around this. It all arose as a result of a very simple pie chart I was doing for a client.

Take the following six numbers:
41.00
22.68
11.03
8.56
8.63
7.23

Format the cells as numbers to two decimal places, then total them. It comes out to 99.13

Then reformat the cells to one decimal place:

41.0
22.7
11.0
8.6
8.6
7.2

Excel does the rounding up/down correctly and the total comes to 99.1.

Then reformat the cells to no decimal places:

41
23
11
9
9
7

Excel again rounds up and down correctly and makes the total 99.

HOWEVER, if you add this last set of numbers up (in your head, or on a calculator if you were born after 1970  ;D), the total is 100.

How can that be?
Logged

STMO123

  • Guest
Re: Any Excel experts out there?
« Reply #1 on: 04 September 2007, 21:16:12 »

I'm no expert at excel Nick, but, simple maths tells me you've added 0.3 to the 22.7 and 0.4 to both the 8.6's which equals........1 :D
« Last Edit: 04 September 2007, 21:51:14 by STMO123 »
Logged

Grumpy

  • Senior Member
  • ****
  • Offline Offline
  • Gender: Male
  • Manchester
  • Posts: 645
    • View Profile
Re: Any Excel experts out there?
« Reply #2 on: 04 September 2007, 21:16:27 »

Because a spreadsheet will always sum the numbers correctly, not just
to the decimal point that you wish it to display.

When it displays the figures, it will round it up or down and
display it to the decimal point that you specified.

In your last column, it has rounded up the figures to display as
whole numbers.
Logged

Entwood

  • Omega Queen
  • *****
  • Offline Offline
  • Gender: Male
  • North Wiltshire
  • Posts: 19566
  • My Old 3.2 V6 Elite (LPG)
    • Audi A6 Allroad 3.0 DTI
    • View Profile
Re: Any Excel experts out there?
« Reply #3 on: 04 September 2007, 21:17:15 »

If you don't format the total line you will see why !!!  although you change the format of each cell you only change it's display .. NOT the content which remains as you  input it .. so the total is rounded on the CONTENT not the display .. it is therefore rounded down to 99  even though each cell is rounded differently.. some up some down
Logged

Golfbuddy

  • Omega Baron
  • *****
  • Offline Offline
  • Gender: Male
  • Cornwall
  • Posts: 4151
  • I'm On An Economy Drive
    • View Profile
Re: Any Excel experts out there?
« Reply #4 on: 04 September 2007, 21:26:46 »

Just because you change the formatting to 'nil' decimal places doesn't mean that the numbers have changed. In your example, the two 9's are still actually 8.56 and 8.63, which makes 17.19 which when rounded to 'nil' decimal places makes 17 and not 18 which it would in your example and the total still makes 99.13. So the answer is quite simple, when you add the column of numbers it does add up to 99 rounded to two decimal places; it will never total 100.

 :P :P
Logged
[size=24]        [/size][/b]

Nickbat

  • Guest
Re: Any Excel experts out there?
« Reply #5 on: 04 September 2007, 21:36:35 »

Thanks guys.

So, it is possible to provide spreadsheet data which nominally shows an incorrect total. I suppose, if you were smart, you could exploit this feature. But, I'm not smart, so I'll stop thinking about it.  ::) ;D ;D
Logged

STMO123

  • Guest
Re: Any Excel experts out there?
« Reply #6 on: 04 September 2007, 21:50:52 »

It's possible to manipulate any list of figures Nick, just depends whether you choose to round them up...or down ;)
Logged

Entwood

  • Omega Queen
  • *****
  • Offline Offline
  • Gender: Male
  • North Wiltshire
  • Posts: 19566
  • My Old 3.2 V6 Elite (LPG)
    • Audi A6 Allroad 3.0 DTI
    • View Profile
Re: Any Excel experts out there?
« Reply #7 on: 04 September 2007, 21:51:15 »

It has been exploited .... several times  !!

The classic case was quite a few years back in the early days of computing/accountancy, a worker in an american bank realised that interest payments were calculated to 4 decimal places of dollars  ie .. 2 decimal places of cents eg $01.1124 but only paid to accounts as cents and always the bank "rounded down"   so $01.1124 would be paid as $01.11. He wrote a small program to have the other little bits $0.0024 (1/4 of a cent) to be paid into a secret account he controlled. Doesn't sound much but with a few hundred thousand accounts it soon added up to a nice amount.

Urban myth on this is that he was never prosecuted but employed by the bank to look for others trying to do similar  !!  :)
Logged

Golfbuddy

  • Omega Baron
  • *****
  • Offline Offline
  • Gender: Male
  • Cornwall
  • Posts: 4151
  • I'm On An Economy Drive
    • View Profile
Re: Any Excel experts out there?
« Reply #8 on: 04 September 2007, 22:01:06 »

Quote
Thanks guys.

So, it is possible to provide spreadsheet data which nominally shows an incorrect total. I suppose, if you were smart, you could exploit this feature. But, I'm not smart, so I'll stop thinking about it.  ::) ;D ;D

Good idea. Go back to designing hall cupboards.  :y
Logged
[size=24]        [/size][/b]

Nickbat

  • Guest
Re: Any Excel experts out there?
« Reply #9 on: 04 September 2007, 22:04:30 »

Quote
Quote
Thanks guys.

So, it is possible to provide spreadsheet data which nominally shows an incorrect total. I suppose, if you were smart, you could exploit this feature. But, I'm not smart, so I'll stop thinking about it.  ::) ;D ;D

Good idea. Go back to designing hall cupboards.  :y

Cheeky git!  >:( >:( ;) ;D ;D ;D ;D

Actually SWMBO was very happy with the cupboard, but demanded I paint the door white as the mahogany clashed with the new pine.  :(
Logged

Golfbuddy

  • Omega Baron
  • *****
  • Offline Offline
  • Gender: Male
  • Cornwall
  • Posts: 4151
  • I'm On An Economy Drive
    • View Profile
Re: Any Excel experts out there?
« Reply #10 on: 04 September 2007, 22:08:58 »

Quote
Quote
Quote
Thanks guys.

So, it is possible to provide spreadsheet data which nominally shows an incorrect total. I suppose, if you were smart, you could exploit this feature. But, I'm not smart, so I'll stop thinking about it.  ::) ;D ;D

Good idea. Go back to designing hall cupboards.  :y

Cheeky git!  >:( >:( ;) ;D ;D ;D ;D

Actually SWMBO was very happy with the cupboard, but demanded I paint the door white as the mahogany clashed with the new pine.  :(

Would have looked nice in a subtle shade of salmon.  ::)
Logged
[size=24]        [/size][/b]

Nickbat

  • Guest
Re: Any Excel experts out there?
« Reply #11 on: 04 September 2007, 22:13:16 »

Quote
Quote
Quote
Quote
Thanks guys.

So, it is possible to provide spreadsheet data which nominally shows an incorrect total. I suppose, if you were smart, you could exploit this feature. But, I'm not smart, so I'll stop thinking about it.  ::) ;D ;D

Good idea. Go back to designing hall cupboards.  :y

Cheeky git!  >:( >:( ;) ;D ;D ;D ;D

Actually SWMBO was very happy with the cupboard, but demanded I paint the door white as the mahogany clashed with the new pine.  :(

Would have looked nice in a subtle shade of salmon.  ::)


I think your angling for a bunch of fives.   ;D ;D ;)

Logged
Pages: [1]   Go Up
 

Page created in 0.013 seconds with 17 queries.