Formula using =IF(MONTH)

davids4500

Board Regular
Joined
Jan 14, 2023
Messages
56
Office Version
  1. 365
Platform
  1. Windows
The formula i am using is:- =IF(MONTH(C4)=1,Superannuation[SUM],"",IF(MONTH(C4)=4,Superannuation[SUM],"", IF(MONTH(C4)=7,Superannuation[SUM],"",IF(MONTH(C4)=10,Superannuation[SUM],""))).
when I use the formula =IF(MONTH(C4)=1,Superannuation[SUM],"") it has a correct result. When i add to it as above, it comes back with (You have entered too many arguments with this function).
C4 is the month in mmmm-yyyy format. So i only want the result posted if it corresponds to the 1st month, 4th month, 7th month or 10th month.
Looking forward to your help
Much appreciated
David
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try this:

Excel Formula:
=IF(OR(MONTH(C4)={1,4,7,10}),Superannuation[SUM],"",

Or:

Excel Formula:
=IF(MOD(MONTH(C4),3)=1,Superannuation[SUM],"",
 
Upvote 0
If you nest the IFs, you only need the value_if_false ("") once, at the end:

=IF(MONTH(C4)=1,Superannuation[Sum],IF(MONTH(C4)=4,Superannuation[Sum],IF(MONTH(C4)=7,Superannuation[Sum],IF(MONTH(C4)=10,Superannuation[Sum],""))))

You could simplify to:

=IF(MOD(MONTH(C4),3)=1,Superannuation[Sum],"")
 
Upvote 0
Solution
Try this:

Excel Formula:
=IF(OR(MONTH(C4)={1,4,7,10}),Superannuation[SUM],"",

Or:

Excel Formula:
=IF(MOD(MONTH(C4),3)=1,Superannuation[SUM],"",
well done and thank you
Much appreciated
David
 
Upvote 0
If you nest the IFs, you only need the value_if_false ("") once, at the end:

=IF(MONTH(C4)=1,Superannuation[Sum],IF(MONTH(C4)=4,Superannuation[Sum],IF(MONTH(C4)=7,Superannuation[Sum],IF(MONTH(C4)=10,Superannuation[Sum],""))))

You could simplify to:

=IF(MOD(MONTH(C4),3)=1,Superannuation[Sum],"")
Yes works great.

Much appreciated
David
 
Upvote 0

Forum statistics

Threads
1,225,738
Messages
6,186,728
Members
453,368
Latest member
positivemind

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