"You've entered too many arguments for this function" Error message

Pookiemeister

Well-known Member
Joined
Jan 6, 2012
Messages
625
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Since our I.T. announced that macros can no longer be used, I have to tried to write this code in the formula line using nested "if" statements but I get the error message stated in the Subject line. Here is what I have written.
Excel Formula:
=IF(Q13=1,COUNTIF('WO Week 1'!B:B,"Support Order (ZM08)"),Q13=2,COUNTIF('WO Week 2'!B:B,"Support Order (ZM08)",Q13=3,COUNTIF('WO Week 3'!B:B,"Support Order (ZM08)",Q13=4,COUNTIF('WO Week 4'!B:B,"Support Order (ZM08)",Q13=5,COUNTIF('WO Week 5'!B:B,"Support Order (ZM08)")))

Q13 contains this code
Excel Formula:
=ROUNDUP(DAY(NOW()) / 7, 0)

Thank you
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You seem to have confused the syntax of IFS with the syntax of IF. IF only accepts 3 arguments. You could simply replace IF with IFS in your formula but you should be aware that IFS will evaluate every single argument passed to it whether it needs to or not, so a nested IF or CHOOSE would be more efficient.
 
Upvote 1
you do not close brackets after couple of COUNTIFs and You should use IFS not IF.
Try:

Excel Formula:
=IFS(Q13=1,COUNTIF('WO Week 1'!B:B,"Support Order (ZM08)"),Q13=2,COUNTIF('WO Week 2'!B:B,"Support Order (ZM08)"),Q13=3,COUNTIF('WO Week 3'!B:B,"Support Order (ZM08)"),Q13=4,COUNTIF('WO Week 4'!B:B,"Support Order (ZM08)"),Q13=5,COUNTIF('WO Week 5'!B:B,"Support Order (ZM08)"))
 
Upvote 0
One option:

Excel Formula:
=IF(AND(Q13>=1,Q13<=5),COUNTIF(CHOOSE(Q13,'WO Week 1'!B:B,'WO Week 2'!B:B,'WO Week 3'!B:B,'WO Week 4'!B:B,'WO Week 5'!B:B),"Support Order (ZM08)"),"")
 
Upvote 0

Forum statistics

Threads
1,221,525
Messages
6,160,327
Members
451,637
Latest member
hvp2262

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