Return value, if blank then return value of another cell

mlu120

New Member
Joined
Dec 4, 2011
Messages
39
Hi,

I want a formula that will return with the value of cell A1 but if cell A1 is blank, then it will take only the value of C1.

I tried using this formula - not working right.

Thanks ;)
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi it works when there is value is cell A1 but when there is a blank in A1, its not returning the value in C1. :(
 
Upvote 0
try =IF(TRIM(A1) = "",C1,A1)

That will work if there are spaces in A1 which is a little different than blank...
 
Upvote 0
thanks! it works. another question - would the results be the same if A1 and C1 have formulas in it?
 
Upvote 0
That is a loaded question... it depends on the formula... in most cases, it will work the same... If you have a simple formula in A1 "=A2" and A2 is Empty (nothing in it at all) then A1 will actually show a 0 and so will the result of the formula... if Cell A2 had a space in it, A1 would have a space, and the trim would work and you would get the result of C1...

Hope that isn't too confusing...
 
Upvote 0
When I have hard coded value in A1 - the formula works great. But if I tried A1 which as a summing formula in it - I get a blank return.
 
Upvote 0
I guess you could try =IF(A1 = 0,C1,A1)

These formulas all depend on the specific use you intend...
 
Upvote 0
=if(a1="",c1,a1)

Hi! Thank you for this reply which almost suits my needs.

I have an additional complexity, which is that I have 4 columns and the content I want to display can be in any one of them.

ex.
line one: col 1 is empty, col 2 is empty, col 3 is empty, col 4 has content
line two: col 1 has content, col 2 is empty, col 3 is empty, col 4 is empty
line three: col 1 is empty, col 2 has content, col 3 is empty, col 4 is empty

Could you help me with this?

Thank you so much
 
Upvote 0

Forum statistics

Threads
1,223,529
Messages
6,172,841
Members
452,484
Latest member
vmexwindy

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