Formula to ignore #N/A and sum values in a row - but HAS to return a #N/A if they are all #N/A

Yukontornado

New Member
Joined
Sep 27, 2017
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I am trying to write a Formula to ignore #N/A and sum values in a row - but HAS to return a #N/A if they are all #N/A (messes up my graphs that are attached if a 0 is returned). Thank you!!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Maybe something like this (for range N1:N30)
Excel Formula:
{=IF(COUNT(N1:N30)>0,SUM(IF(ISNA(N1:N30),0,N1:N30)),NA())}
Note that the squiggly brackets indicates that the formula has to be entered with CTRL+SHIFT+ENTER, not just ENTER.
 
Last edited:
Upvote 0
the AGGREGATE function can be used to bypass the errors. Try this

=IF(COUNTIF(A1:A10,NA())=COUNTA(A1:A10),NA(),AGGREGATE(9,3,A1:A10))
 
Upvote 0
Thank you Joe4. I don't have time to verify this today, but I will work with it on Monday!!

C.
 
Upvote 0
Maybe something like this (for range N1:N30)
Excel Formula:
{=IF(COUNT(N1:N30)>0,SUM(IF(ISNA(N1:N30),0,N1:N30)),NA())}
Note that the squiggly brackets indicates that the formula has to be entered with CTRL+SHIFT+ENTER, not just ENTER.
Hey Joe4, I just wanted to thank you that your solution worked perfectly!! Now I can stop pulling out what I have left of my hair, lol. I really appreciate your knowledge. Have a great day!

Chris
 
Upvote 0
the AGGREGATE function can be used to bypass the errors. Try this

=IF(COUNTIF(A1:A10,NA())=COUNTA(A1:A10),NA(),AGGREGATE(9,3,A1:A10))
Hi Richh,
I did not have a chance to test your solution, but the solution Joe4 provided worked nicely. If I get a chance to validate another solution I will try yours as well. Thank you for taking the time to post a solution to my problem! Have a great day.

Chris
 
Upvote 0
Hey Joe4, I just wanted to thank you that your solution worked perfectly!! Now I can stop pulling out what I have left of my hair, lol. I really appreciate your knowledge. Have a great day!
You are welcome.
Glad we were able to help.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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