IF Function

Lewy2

New Member
Joined
Mar 16, 2002
Messages
19
Whats wrong withthe following formula,
=IF(A32="Door Panel",IF(B32<0>1200,2,IF(B32<1200>1600,3,IF(B32<1600>2100,4,IF(B32>2100,5,0)))))
What I'm trying to do is,the cell A32 has "Door Panel" in it and the sell B32 is less than 1200 insert 2 however if the sell B32 is greater than 1200 and less than 1600 then insert 3 and so on then if none of the criteria match insert 0.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Try
=IF(A32="Door Panel",IF(B32<1200,2,IF(B32<1600,3,IF(B32<2100,4,IF(B32>=2100,5)))),0)
HTH
Richard
 
Upvote 0
On 2002-03-17 21:29, Lewy2 wrote:
Whats wrong withthe following formula,
=IF(A32="Door Panel",IF(B32<0>1200,2,IF(B32<1200>1600,3,IF(B32<1600>2100,4,IF(B32>2100,5,0)))))
What I'm trying to do is,the cell A32 has "Door Panel" in it and the sell B32 is less than 1200 insert 2 however if the sell B32 is greater than 1200 and less than 1600 then insert 3 and so on then if none of the criteria match insert 0.

Hi Lewy2:
Your syntax needs correcting ... your formula should read as follows:

=IF(A32="Door Panel",IF(B32<=1200,2,IF(AND(B32>1200,B32<=1600),3,IF(AND(B32>1600,B32<2100),4,IF(B32>=2100,5,0)))))

I took the liberty of assuming that you mean if B32 is <=1200, and so on

I hope this is what you want ... please post if it works for you, otherwise explain a little further what you are trying to accomplish!
 
Upvote 0
My apologies ... Richard had alredy posted not only the right syntax, but he had also removed the unnecessary baggage of using 'and' statements, meaning he had also corrected the logic. Way to go Richard!
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

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