Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I use a check box to accept a calculation | Excel Discussion (Misc queries) | |||
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) | Excel Worksheet Functions | |||
How do I use a rounded calculation result in another calculation? | Excel Worksheet Functions | |||
How do I use a rounded calculation result in another calculation? | Excel Worksheet Functions | |||
time-clock calculation | Excel Worksheet Functions |