SUM range ONLY if adjacent cell is not BLANK

jkalpus

New Member
Joined
Apr 17, 2004
Messages
46
Greetings. I have two columns of data. I want to sum up one column of numbers ONLY if the next to each number there is text in the column. If a number has no text in the adjacent cell, I want to ignore that cell's number in the total sum. Should I use SUMIF, and if so, how? Thanks!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try this where column B contains the values to sum and column A contains the cells that are text:

=Sumif(A:A,"<>"&"",B:B)

If you want it to be text and not numeric either then try:

=SUM(IF(ISTEXT(A1:A100),B1:B100,0))

Confirmed with control+shift+enter and not just enter.

Change column references as necessary. Hope that helps.
 
Last edited:
Upvote 0
Thank you both! That works like a champ. I actually tried the "<>" trick and couldn't get it to work. It works fine now. Thanks!
 
Upvote 0
Hi, I would like to have the Colum "Total AB - Total CD" showing the result only in the cell showing data. Thank you very much, Aleks
A
B
Total AB
C
D
Total CD
Total AB -Total CD
$1.00

$1.00







$1.00

$1.00

$1,210.44

$1,211.44




$164.00

$1,375.44





$347.48
$1,027.96







$225.00

$226.00

$164.00

$1,191.96





<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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