Problem with blank cell in finding top n values

toufik3078

New Member
Joined
Apr 25, 2016
Messages
4
I want to find the sum of top 3 values from several datas..But if my datasheet is not complete(that means i have less than two datas) and I want to get sum of the two datas..How can I do that?(if I put 0 on the blank cells,it works.But I dont want to put 0,I need to solve it by having the blank cells
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You should just be able to SUM them even if there is an empty cell. It would only use the 2 Values to SUM. If for some reason you're getting an error when you try to SUM (3) Values but only (2) are available maybe try something like this:

Code:
=IFERROR(SUM(A1:A3),SUM(A1:A2))

Just replace A1:A3 and A1:A2 with the cells you're trying to SUM.
 
Upvote 0
You should just be able to SUM them even if there is an empty cell. It would only use the 2 Values to SUM. If for some reason you're getting an error when you try to SUM (3) Values but only (2) are available maybe try something like this:

Code:
=IFERROR(SUM(A1:A3),SUM(A1:A2))

Just replace A1:A3 and A1:A2 with the cells you're trying to SUM.

But for the next to,I need to do B1,B3 as for B2 it shows error..then I have to write a different logic.Is there any way to put just one logic? Thanks by the way:)
 
Upvote 0
And I need to show for the result if there is only one value..For two value your solution is okay..but what I do if I need to show when there is only one value?
 
Upvote 0
So I'm not sure which type of errors you have but if they're all the same then you can use something like this:

Code:
=+SUMIF(A1:A3,"<>#DIV/0")

Where you'd replaced the "#DIV/0!" portion with whichever error message is in the cell if they're consistent.

You could also try:

Code:
=+IF(ISNUMBER(A1),A1,"")

Then Drag this function through from Column A1 to Column Z1 (However far your data goes); Then repeat this from A2 to Z2; and A3 to Z3. It will pull all the number values out of the data and then you can sum the newly created table of values.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,008
Members
448,935
Latest member
ijat

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