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

Pookiemeister

Well-known Member
Joined
Jan 6, 2012
Messages
626
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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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
I ran into a problem I thought this might be issue, but I wasn't sure, so I didn't mention it here and the logic part of my brain is overheated trying to figure this issue out. The issue would occur at the beginning of every month. Based on the formula below, and since most months have approximately 5 weeks in them, if a person were to enter a value for week 5 in the new month, the formula would show 1 instead of 5. This is where I am stuck, any ideas? Thank you.

Excel Formula:
=ROUNDUP(DAY(NOW()) / 7, 0)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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