Iferror message with SUM and IF

AdamSalam

New Member
Joined
Mar 10, 2018
Messages
15
Hi everyone ..

I am working on an "Array" formula to SUM totals of specific month like so ..

=SUM(IF(MONTH($B6:$B263)=$E$6,$C6:$C263,""))

The problem is that if the user enter a value of the month like 13, for example, the total amount getting "0"

I add the IFERROR function so in that case there should be a message telling the user to enter only values between 1 and 12


I tried the below...
=IFERROR(SUM(IF(MONTH($B6:$B263)=$G$7,$C6:$C263,"")), "Month between 1-12")

unfortunately in case of error I get "0" total

can any body correct me on the same

thank you
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Try

=IF(MEDIAN(1,12,$E$6)=$E$6,SUM(IF(MONTH($B6:$B263)=$E$6,$C6:$C263,"")),"Month between 1-12")
Ctrl+Shift+Enter

M.
 
Upvote 0
How about something like this:

=IF(AND($G$7>=1,$G$7<=12),SUM(IF(MONTH($B6:$B263)=$G$7,$C6:$C263,"")), "Month between 1-12")

Do you have SUMIF or SUMIFS?

I would also use Data Validation in G7 (or wherever the user is entering the month)
 
Last edited:
Upvote 0
after extracting the Month number from the date column

<tbody>
</tbody>

I tried :
=IFERROR(SUMIFS(D6:D263,C6:C263,J9),"wrong month entry")

with no avail :(

<tbody>
</tbody>
 
Last edited:
Upvote 0
Joyner
=IF(AND($G$7>=1,$G$7<=12),SUM(IF(MONTH($B6:$B263)=$G$7,$C6:$C263,"")), "Month between 1-12")
works perfect :)
still looking for implementing IFERROR and shorter formula, why its NOT working in this situation ?

thank you
 
Upvote 0
thanks Marc

=IF(MEDIAN(1,12,$E$6)=$E$6,SUM(IF(MONTH($B6:$B263)=$E$6,$C6:$C263,"")),"Month between 1-12")
Ctrl+Shift+Enter

working great

Still looking for shorter formula , and why IFERROR not working?

Appreciate you help
 
Upvote 0

still looking for implementing IFERROR and shorter formula, why its NOT working in this situation ?


IFERROR works with formula errors like #Value , #Ref , #N/A, etc, so if your formula doesn't result in one of those errors, it won't do anything.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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