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
 

dave2018

Board Regular
Joined
Mar 20, 2018
Messages
222
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:

Kwnstantinos_M

New Member
Joined
Jun 12, 2018
Messages
24
Thank you very much... the problem obviously was that I was using 2 ";" instead of 1, after the if.. Thank you, it works!
 

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
5,146
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))))
 

Forum statistics

Threads
1,081,929
Messages
5,362,182
Members
400,671
Latest member
Tommy00836

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top