Need formula to sum if not blank

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
I want to do this formula
Code:
=vlookup(1,W2:Y5,3,false)
but only when every cell in I14:I19 are greater than "" (not empty)

How can I do this with a formula?


Thank You,
Michael
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
What kind of values are in I14:I19?
Alpha or numeric?
Is zero a valid number that might show up?
 
Upvote 0
I am almost embarrassed to offer this solution, because I know that there has to be a better one (just can't think straight right now), but checking the length of each of those 6 cells should work:
Code:
=IF(AND(LEN(I14)>0,LEN(I15)>0,LEN(I16)>0,LEN(I17)>0,LEN(I18)>0,LEN(I19)>0),vlookup(1,W2:Y5,3,false),"")
 
Upvote 0
You got me thinking when you mentioned zero. I then thought about "blanks"
How about:
=if(countblank(I14:I19)=0,vlookup(1,W2:Y5,3,false),"")

Thank You,
Michael
 
Upvote 0
I am almost embarrassed to offer this solution, because I know that there has to be a better one (just can't think straight right now), but checking the length of each of those 6 cells should work:
Code:
=IF(AND(LEN(I14)>0,LEN(I15)>0,LEN(I16)>0,LEN(I17)>0,LEN(I18)>0,LEN(I19)>0),vlookup(1,W2:Y5,3,false),"")

Maybe...

=IF(COUNTBLANK(I14:I19),"",VLOOKUP(1,W2:Y5,3,0))
 
Upvote 0
I want to do this formula
=vlookup(1,W2:Y5,3,false)
but only when every cell in I14:I19 are greater than "" (not empty)

How can I do this with a formula?


Thank You,
Michael
Does that mean there might be cells that contain formula blanks in the range I14:I19?
 
Upvote 0
And there it is!

To tell you the truth, I have never used the COUNTBLANK function before, and actually didn't even know that one existed (never really had a need for it).
It certainly comes in handy in these situations.

So, it looks like you asked the question, but I learned something new today!
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,357
Members
452,907
Latest member
Roland Deschain

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