Problem with a formula

metsmaniac

Board Regular
Joined
Jan 29, 2010
Messages
57
Office Version
  1. 365
Platform
  1. Windows
I can't get this formula to return value 99 if cell C10 is blank:
=IF(AND(B10="H",C10=0),"99",C10)

I've tried this:
=IF(AND(B10="H",C10=""),"99",C10)

and this:
=IF(AND(B10="H",trim(C10=0)),"99",C10)

The formula only returns the contents of C10 if C10 is populated, but it doesn't return value 99 if it's blank.

Can anyone help?
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
What does it return?
Also is there anything in C10, such as a formula?
 
Upvote 0
What is in C10? Is it a formula that returns blank or is it really blank?
 
Upvote 0
C10 is blank.
I ran an Access 2013 query and pasted the "text results only" into an Excel spreadsheet.
The formula returns whatever value is in C10, so if C10 is blank, it returns blank.
I tried running the 'text to value' formula on C10. No luck.
 
Upvote 0
Put this in an empty cell, what does it return
=code(C10)
 
Upvote 0
In that case it contains a space, try
=IF(AND(B10="H",len(trim(C10))=0),"99",C10)
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

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