Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Troi-Xanh
 
Posts: n/a
Default Weird interger calculation

I try to create formulas to calculate parking meter 'feeding' combination and
get the INTERGER (=int) function problem:

DATA: and FORMULA:
Cell 'B1' is the number of minutes :
45 minutes for a Quarter (A2) =INT(B1/A2)
18 minutes for a Dime (A3) =INT((B1-(B2*A2))/A3)
9 minutes for a Nickel (A4) =INT((B1-((B2*A2)+(B3*A3)))/A4)

With "160 minutes" (@ B1) I get correct calculations for Quarter (3) and
Dime (1) but REZO for Nickel (supposedly= 1). If I remove the =INT in formula
for Nickel, I get the correct answer '1' (but I also get the decimal in other
cases!)

With "151 minutes" (@ B1) I get correct for Quarter (3), but REZO for Dime
(supposedly 1) and ONE for Nickel (supposedly 0). If I remove the 'INT'
formula, I get '0.888889' for Dime AND 2 (TWO) for Nickel!

Is that weird? Any explanation is deeply appreciated.



  #2   Report Post  
Troi-Xanh
 
Posts: n/a
Default

The number is "162" and "153" (instead of 160 and 151)

Sorry for the mixed-ups

"Troi-Xanh" wrote:

I try to create formulas to calculate parking meter 'feeding' combination and
get the INTERGER (=int) function problem:

DATA: and FORMULA:
Cell 'B1' is the number of minutes :
45 minutes for a Quarter (A2) =INT(B1/A2)
18 minutes for a Dime (A3) =INT((B1-(B2*A2))/A3)
9 minutes for a Nickel (A4) =INT((B1-((B2*A2)+(B3*A3)))/A4)

With "160 minutes" (@ B1) I get correct calculations for Quarter (3) and
Dime (1) but REZO for Nickel (supposedly= 1). If I remove the =INT in formula
for Nickel, I get the correct answer '1' (but I also get the decimal in other
cases!)

With "151 minutes" (@ B1) I get correct for Quarter (3), but REZO for Dime
(supposedly 1) and ONE for Nickel (supposedly 0). If I remove the 'INT'
formula, I get '0.888889' for Dime AND 2 (TWO) for Nickel!

Is that weird? Any explanation is deeply appreciated.



  #3   Report Post  
Adam
 
Posts: n/a
Default

I assume that now you get the correct figures.
The reason for you getting 0 for the nickels is of course because the
remainder from 3 quarters and one dime is only 7 when using 160 minutes.

The same of course applies to the second query.

"Troi-Xanh" skrev:

The number is "162" and "153" (instead of 160 and 151)

Sorry for the mixed-ups

"Troi-Xanh" wrote:

I try to create formulas to calculate parking meter 'feeding' combination and
get the INTERGER (=int) function problem:

DATA: and FORMULA:
Cell 'B1' is the number of minutes :
45 minutes for a Quarter (A2) =INT(B1/A2)
18 minutes for a Dime (A3) =INT((B1-(B2*A2))/A3)
9 minutes for a Nickel (A4) =INT((B1-((B2*A2)+(B3*A3)))/A4)

With "160 minutes" (@ B1) I get correct calculations for Quarter (3) and
Dime (1) but REZO for Nickel (supposedly= 1). If I remove the =INT in formula
for Nickel, I get the correct answer '1' (but I also get the decimal in other
cases!)

With "151 minutes" (@ B1) I get correct for Quarter (3), but REZO for Dime
(supposedly 1) and ONE for Nickel (supposedly 0). If I remove the 'INT'
formula, I get '0.888889' for Dime AND 2 (TWO) for Nickel!

Is that weird? Any explanation is deeply appreciated.



  #4   Report Post  
Troi-Xanh
 
Posts: n/a
Default

It's weird that after doing something else, I came back to the worksheet and
there is the CORRECT answers. (BTW, the numbers are NEVER '160' and '151' but
always '162' and '153').

This morning (4/14) I use different number "171" which either as direct
input or from a calculation "minutes between to times" =(E1-E2)*1440, when
E1=4:45 and E2=1:54. the results are :

Quarter = 3
Dime = 1 --- supposedly 2
Nickel = 1 --- supposedly 0

LEFTOVER= 9 (minutes, using formula 'B1-((D2*A2)+(D3*A3)+(D4*A4))'

'Working on something elso them coming back' doesn't fix the problem! I
cannot make sense of it. How can I get the correct answer for the first
time). Thanks for all the help.


"Adam" wrote:

I assume that now you get the correct figures.
The reason for you getting 0 for the nickels is of course because the
remainder from 3 quarters and one dime is only 7 when using 160 minutes.

The same of course applies to the second query.

"Troi-Xanh" skrev:

The number is "162" and "153" (instead of 160 and 151)

Sorry for the mixed-ups

"Troi-Xanh" wrote:

I try to create formulas to calculate parking meter 'feeding' combination and
get the INTERGER (=int) function problem:

DATA: and FORMULA:
Cell 'B1' is the number of minutes :
45 minutes for a Quarter (A2) =INT(B1/A2)
18 minutes for a Dime (A3) =INT((B1-(B2*A2))/A3)
9 minutes for a Nickel (A4) =INT((B1-((B2*A2)+(B3*A3)))/A4)

With "160 minutes" (@ B1) I get correct calculations for Quarter (3) and
Dime (1) but REZO for Nickel (supposedly= 1). If I remove the =INT in formula
for Nickel, I get the correct answer '1' (but I also get the decimal in other
cases!)

With "151 minutes" (@ B1) I get correct for Quarter (3), but REZO for Dime
(supposedly 1) and ONE for Nickel (supposedly 0). If I remove the 'INT'
formula, I get '0.888889' for Dime AND 2 (TWO) for Nickel!

Is that weird? Any explanation is deeply appreciated.



  #5   Report Post  
Troi-Xanh
 
Posts: n/a
Default

IT'S MORE WEIRD !!!

1. It happens ONLY when 'time input' is used in the calculation! If the
number is directly input, the calculation is correct!

2. For the correction of 'time input' check the box of "Precision as
display" in the section 'Workbook options' (Tools / Options).

However you are warned "DATA WILL PERMANENTLY LOSE ACCURACY" !

What's the catch/side-effect ? The end result is correct! Anyone can shred
a light onto this weird thing? Thanks in advance.

"Troi-Xanh" wrote:

It's weird that after doing something else, I came back to the worksheet and
there is the CORRECT answers. (BTW, the numbers are NEVER '160' and '151' but
always '162' and '153').

This morning (4/14) I use different number "171" which either as direct
input or from a calculation "minutes between to times" =(E1-E2)*1440, when
E1=4:45 and E2=1:54. the results are :

Quarter = 3
Dime = 1 --- supposedly 2
Nickel = 1 --- supposedly 0

LEFTOVER= 9 (minutes, using formula 'B1-((D2*A2)+(D3*A3)+(D4*A4))'

'Working on something elso them coming back' doesn't fix the problem! I
cannot make sense of it. How can I get the correct answer for the first
time). Thanks for all the help.


"Adam" wrote:

I assume that now you get the correct figures.
The reason for you getting 0 for the nickels is of course because the
remainder from 3 quarters and one dime is only 7 when using 160 minutes.

The same of course applies to the second query.

"Troi-Xanh" skrev:

The number is "162" and "153" (instead of 160 and 151)

Sorry for the mixed-ups

"Troi-Xanh" wrote:

I try to create formulas to calculate parking meter 'feeding' combination and
get the INTERGER (=int) function problem:

DATA: and FORMULA:
Cell 'B1' is the number of minutes :
45 minutes for a Quarter (A2) =INT(B1/A2)
18 minutes for a Dime (A3) =INT((B1-(B2*A2))/A3)
9 minutes for a Nickel (A4) =INT((B1-((B2*A2)+(B3*A3)))/A4)

With "160 minutes" (@ B1) I get correct calculations for Quarter (3) and
Dime (1) but REZO for Nickel (supposedly= 1). If I remove the =INT in formula
for Nickel, I get the correct answer '1' (but I also get the decimal in other
cases!)

With "151 minutes" (@ B1) I get correct for Quarter (3), but REZO for Dime
(supposedly 1) and ONE for Nickel (supposedly 0). If I remove the 'INT'
formula, I get '0.888889' for Dime AND 2 (TWO) for Nickel!

Is that weird? Any explanation is deeply appreciated.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use a check box to accept a calculation Joejoethecrackman Excel Discussion (Misc queries) 5 March 22nd 05 08:47 PM
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) RICHARD Excel Worksheet Functions 1 March 15th 05 05:49 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 10:11 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 09:36 PM
time-clock calculation dokliver Excel Worksheet Functions 3 October 28th 04 09:07 PM


All times are GMT +1. The time now is 09:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"