If a cell is blank give return this cell, if that cell is also blank return this cell

Craigc3814

Board Regular
Joined
Mar 7, 2016
Messages
217
If cell C18 has a value return me that value if it is blank return me cell 21 but if cell c21 doesn't have a value return me cell e21, if that is also blank return me I21.

Here are the 3 formulas I have been trying and they all only work in certain instances.

=IF(ISBLANK(C18),IF(ISBLANK(C21),IF(ISBLANK(E21),I21,E21),C21),C18)

=IFERROR(1/(1/C18),IF(ISBLANK(C18),C21,IF(ISBLANK(E21),I21,E21)))

=IF(C18=" ",C21,IF(C21=" ",E21,IF(E21=" ",I21,IF(I21=" ","Not Selected",C18)*C21)*E21)*I21)
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Give this formula a try...

=IF(C18="",IF(C21="",IF(E21="",I21,E21),C21),C18)
 
Upvote 0
It is only working if there is a value in C18 if I move a value to C21, E21, or I21 it is returning nothing. I thought there should be an AND statement included but cant figure it out
 
Upvote 0
This may be easier to read:
Code:
=IF(C18<>"",C18,IF(C21<>"",C21,IF(E21<>"",E21,I21)))
But it returns the same result as Rick's; both are 1:1 codings to Excel from your definition (with small correction in red):
"If cell C18 has a value return me that value if it is blank return me cell c21 but if cell c21 doesn't have a value return me cell e21, if that is also blank return me I21."

So if the result is not ok, then your definition is not ok either.

Edit: do you mean with "move a value" that you are dragging C18 to e.g. C21? That might result in #REF! errors in the formula and/or in the result.
 
Last edited:
Upvote 0
Yea, I think I am not explaining it correctly. Cell c18,c21,g21, or cell i21 SHOULD always have 1 value. Meaning that if there is a value in cell c18 the other cells are blank. If there is a value in cell e21 the other cells should be blank. So when there is a value in cell c18 stop right there and give me that value. If there is a value in cell e21 and cell c18 and d21 are blank stop right there and return to me what is in cell E21.

Does that help? I feel like it should be a fairly easy formula I am just doing a poor job at explaining it
 
Upvote 0
Try
Code:
=C18&C21&G21&I21
Or, if values are numeric
Code:
=SUM(C18,C21,G21,I21)
Not clear if you mean G21 or E21.
 
Upvote 0

Forum statistics

Threads
1,214,390
Messages
6,119,235
Members
448,879
Latest member
VanGirl

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