Returning values

JasmineL

Active Member
Joined
Jan 7, 2003
Messages
299
I'm playing with a formula and must have a brain fart. Here's what I want...the formula looks in column B and if there something in cell B1 and B2, the formula returns the sum of the corresponding values in cells A1 and A2. I know this is easy, but I can't remember how to do it. Please help!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Try this:

=IF(AND(B1<>"",B2<>""),SUM(A1:A2),"")

Or try this shorter one, but you must enter it with the keystrokes Ctrl + Shift + Enter:

=IF(AND(B1:B2<>""),SUM(A1:A2),"")

These will return a blank in there is not data in both B1 and B2.
 
Upvote 0
Thank you for the suggestions. My issue is this...what if I'm searching in a range of cells, B4:B70. B4 and B20 aren't empty, so I want the sum of the values in A4 and A20. Does this clarify a bit?
 
Upvote 0
So what if 3 cells, or 15 cells, aren't empty. Do you want the sum of the corresponding cells in column A?
 
Upvote 0
Yes Sir! If the values in 50 cells in column B in the specified range aren't empty, then I want the sum of their corresponding values in column A.
 
Upvote 0
Please don't call me Sir - it makes me nervous :)

Try

=SUMIF(B4:B70,"<>",A4:A70)
 
Upvote 0
Oh my goodness, I was so close...thank you! nonSir :) Is there an AND I can add to disregard cells which do not have visual entries, but might have hidden spaces?
 
Upvote 0
There's a better way to do this but being a formula moron I cannot get the right syntax. Try

=SUMIF(B4:B70,"<>",A4:A70)-SUMIF(B4:B70," *",A4:A70)
 
Upvote 0

Forum statistics

Threads
1,215,136
Messages
6,123,246
Members
449,093
Latest member
Vincent Khandagale

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