# If statement...does not work!

#### rlnye

##### New Member

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

Thanks before hand.

### Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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))

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

well, i can see that i am too slow for you PaddyB

Or maybe
=IF(H9=2,(I9*2)*H5,IF(H9=3,(I9*3)*H5,0))

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

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

Replies
5
Views
188
Replies
4
Views
177
Replies
3
Views
205
Replies
4
Views
356
Replies
4
Views
160

1,196,329
Messages
6,014,680
Members
441,835
Latest member
rthomas268

### 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.

### Which adblocker are you using?

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

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