SUMIF Not Working Inside IF Statement

mcmuney

Board Regular
Joined
Sep 11, 2015
Messages
101
Office Version
  1. 365
1. I have this formula that works: =SUMIF(H1467:I1467,"<>#N/A",H1467:I1467)

2. Now I'm trying to include the SUMIF formula inside of: =IF(I1467="","",IF(A1467=B1467,H1467,H1467+I1467))

3. Making it: =IF(I1467="","",IF(A1467=B1467,H1467,SUMIF(H1467:I1467,"<>#N/A",H1467:I1467)))

The SUMIF formula works on its own (as shown on #1), but it does not work inside the IF statement (as shown on #3).

H1467 = -177
I1467 = #N/A

#1 result = -177
#2 result = #N/A
#3 result = #N/A

Is there a reason for this? If yes, what's the fix?

Thanks.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
This part is giving error

I1467=""

Check this and revert -

Excel Formula:
=IF(NOT(ISNA(I1467)),"",IF(A1467=B1467,H1467,SUMIF(H1467:I1467,"<>#N/A",H1467:I1467)))
 
Upvote 0
What should happen if I1467 is #N/A, do you want to show ""
 
Upvote 0
This part is giving error

I1467=""

Can you tell me why this is an error? In my scenario I1467 has #N/A, which is not ="".

Also, your formula works only when I1467 is #N/A. When it has a value it does not SUM H1467:I1467.
 
Upvote 0
Check this and revert -

Excel Formula:
=IFS(ISNA(I1467),H1467,I1467="","",A1467=B1467,H1467,TRUE,SUMIF(H1467:I1467,"<>#N/A",H1467:I1467))
 
Upvote 0
Another option
Excel Formula:
=IF(OR(ISNA(I1467),A1467=B1467),H1467,IF(I1467="","",SUMIF(H1467:I1467,"<>#N/A",H1467:I1467)))
 
Upvote 0

Forum statistics

Threads
1,221,384
Messages
6,159,563
Members
451,573
Latest member
XcL_

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