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

JRRT

New Member
Joined
Mar 19, 2002
Messages
21
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
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi JRRT

Are you sure the formula in D2 is really getting 30 and not 30.#### ? Try increasing the decimal places.
 
Upvote 0
Yes, that is the problem is there a way to make it use the 30 instead of 30.4 that the formula produces.
 
Upvote 0
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)
 
Upvote 0
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))
 
Upvote 0
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.
 
Upvote 0
Better make that...

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

ROUND's 2nd argument is required!
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,414
Members
448,895
Latest member
omarahmed1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top