If statement...does not work!

rlnye

New Member
Joined
Apr 7, 2002
Messages
43
Can anyone please help and tell me what's wrong with the following If function.

=IF(H9=2,(I9*2)*H5),IF(H9=3,(I9*3)*H5)

Thanks before hand.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
bracket in the wrong place after the first instance of H5 effectively closing off the iff statement. try:

=IF(H9=2,(I9*2)*H5,IF(H9=3,(I9*3)*H5))

paddy
 
Upvote 0
On 2002-08-25 17:03, Tommy Bak wrote:
well, i can see that i am too slow for you PaddyB :smile:

by less than a second though!

EDIT: & dantb has a good point - you should consider what you wnat to happen if the values are not 2 / 3. If there are more than a few different conditions, you might consider a lookup table.

& one last point - given that if H9 is 2, you're multiplying by 2, & by 3 if it's 3, why not:

=I9*H9*H5
This message was edited by PaddyD on 2002-08-25 17:13
 
Upvote 0

Forum statistics

Threads
1,222,312
Messages
6,165,275
Members
451,949
Latest member
bovacik

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