Thanks:  0
Likes:  0

Thread: What to do if formulas in cells conflict with results in oth

1. I have the following formula in cell F2
=IF(COUNTIF(A24:A28,E2),INDEX(D24:D28,MATCH(E2,A24:A28,0))*D2,0)

And the following formula in Cell D2
=IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))

The number that the above formula produces in D2 is 30. The formula in F2 is supposed take the number that is produced in D2 and come up with 2,370, which is the correct answer. But it comes up with the incorrect answer of 2401.60.

If I remove the formula from D2 and just type in the number 30 it works correctly. Any ideas on why the formula in cell D2 affects the outcome? Thanks

2. Hi JRRT

Are you sure the formula in D2 is really getting 30 and not 30.#### ? Try increasing the decimal places.

3. Yes, that is the problem is there a way to make it use the 30 instead of 30.4 that the formula produces.

4. Yes, use the ROUND function.

=ROUND(30.4,0)

5. On 2002-03-22 07:49, JRRT wrote:
Yes, that is the problem is there a way to make it use the 30 instead of 30.4 that the formula produces.
=IF(COUNTIF(A24:A28,E2),INDEX(D24:D28,MATCH(E2,A24:A28,0))*INT(D2),0)

6. The number in D2 will change is there a way to add it to the formula in D2 so that no matter wht number is in it it will round it? here is the formula. Thanks
=IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))

7. On 2002-03-22 07:57, JRRT wrote:
The number in D2 will change is there a way to add it to the formula in D2 so that no matter wht number is in it it will round it? here is the formula. Thanks
=IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))
Use...

=ROUND(IF(B2="i",C2/2.5,IF(B2="d",C2/4,0)),0)

or...

=TRUNC(IF(B2="i",C2/2.5,IF(B2="d",C2/4,0)))

...depending on which one is more appropriate for your application.

8. =ROUND(IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))
)

Should work.

9. Better make that...

=ROUND(IF(B2="i",C2/2.5,IF(B2="d",C2/4,0)),0)

ROUND's 2nd argument is required!

10. Thank you very much it works great!

User Tag List

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•