Too many arguments to function in "if" function

Kwnstantinos_M

New Member
Joined
Jun 12, 2018
Messages
24
Hello

I wrote a formula in order to trace the boundaries of some wind values. The boundaries are 0-90 / 91-180 / 181-270 / 271-360, and in return I want to get 0 for the first group, 1,2,3 for the second,third and fourth respectively. The formula is the next one:

=if(R2<=90;0;;if(and(R2>=91;R2<=180);1;;if(and(R2>=181;R2<=270);3;;if(and(R2>=271;R2<=360);4;;)

The outcome is "too many arguments" . What do you think it's wrong?

(e.g. I use ; instead of , because my data had comma and there would be a problem with the calculations)

Thank you in advance
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
THis works for me:

=IF(R2<=90,0,IF(AND(R2>=91,R2<=180),1,IF(AND(R2>=181,R2<=270),3,IF(AND(R2>=271,R2<=360),4))))

still not sure why u use ; instead of ,


___________________

edit: btw, if u have excel 2016, u can use this shortened version:

=IFS(R2<91,0,R2<181,1,R2<271,2,R2<=360,3)
 
Last edited:
Upvote 0
Hi,

Personally, I'd go with the LOOKUP as suggested by admiral100, but here's a shortened version of the IF formula, you Don't need any of the AND statements:

=IF(R2<=90,0,IF(R2<=180,1,IF(R2<=270,3,IF(R2<=360,4))))
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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