Conditional display of either cell A or B contents in Cell C

svendfj

Board Regular
Joined
Mar 19, 2011
Messages
99
Office Version
  1. 2016
Platform
  1. Windows
Hello,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
I had a working nested IF statement that I used to display text in Cell E1, based on the response (Yes or No) to 6 questions. The number of questions was subsequently raised to 8, exceeding the limit for nested IF statements. So I broke the if statement in two- there are nested IF statements in Cell D1 and Cell D2.
There are 3 possible outcomes:
1) Cell D1 has text
2) Cell D2 has text
3) Both Cell D1 and Cell D2 are empty.
I am trying to develop a formula that will – if Cell D1 or Cell D2 has text, will display that text in cell E1. (for either outcomes 1 or 2).
<o:p> </o:p>
Note this is a simplified version.
<o:p> </o:p>
Thanks,
David
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hello,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
I had a working nested IF statement that I used to display text in Cell E1, based on the response (Yes or No) to 6 questions. The number of questions was subsequently raised to 8, exceeding the limit for nested IF statements. So I broke the if statement in two- there are nested IF statements in Cell D1 and Cell D2.
There are 3 possible outcomes:
1) Cell D1 has text
2) Cell D2 has text
3) Both Cell D1 and Cell D2 are empty.
I am trying to develop a formula that will – if Cell D1 or Cell D2 has text, will display that text in cell E1. (for either outcomes 1 or 2).
<o:p> </o:p>
Note this is a simplified version.
<o:p> </o:p>
Thanks,
David
If D1 and D2 both have text, say, FAD and KAD, what do you want to display in E1?
 
Upvote 0
Hello,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
I had a working nested IF statement that I used to display text in Cell E1, based on the response (Yes or No) to 6 questions. The number of questions was subsequently raised to 8, exceeding the limit for nested IF statements. So I broke the if statement in two- there are nested IF statements in Cell D1 and Cell D2.
There are 3 possible outcomes:
1) Cell D1 has text
2) Cell D2 has text
3) Both Cell D1 and Cell D2 are empty.
I am trying to develop a formula that will – if Cell D1 or Cell D2 has text, will display that text in cell E1. (for either outcomes 1 or 2).
<o:p></o:p>
Note this is a simplified version.
<o:p></o:p>
Thanks,
David
And what do you want to do for outcome 3?

Try this...

=IF(COUNTA(D1,D2),E1,"")

If both cells are empty then the formula returns a blank.
 
Upvote 0
Thank you very much!

The 3 possible outcomes are"
1) Text in Cell D1 --> display that text in Cell E1
2) Text in Cell D2 --> display that text in Cell E1
3) Both Cells D1 and D2 are empty --> do nothing

I would like to place a formula in Cell E1 that will display the text in whichever cell (D1 or D2) has text (case 1 or 2), or just stays empty for Case 3.

'=IF(COUNTA(D1,D2),E1,"")' placed in cell E1 gives a circular reference error, but I have tired variations of this with no luck.

Thanks again.

David
 
Upvote 0
Thank you very much!

The 3 possible outcomes are"
1) Text in Cell D1 --> display that text in Cell E1
2) Text in Cell D2 --> display that text in Cell E1
3) Both Cells D1 and D2 are empty --> do nothing

I would like to place a formula in Cell E1 that will display the text in whichever cell (D1 or D2) has text (case 1 or 2), or just stays empty for Case 3.

'=IF(COUNTA(D1,D2),E1,"")' placed in cell E1 gives a circular reference error, but I have tired variations of this with no luck.

Thanks again.

David

You did not answer the question what should happen in case both D1 and D2 have text. Maybe you just want:

E1:

=IF(D1<>"",D1,IF(D2<>"",D2,""))
 
Upvote 0
Thank you very much!

The 3 possible outcomes are"
1) Text in Cell D1 --> display that text in Cell E1
2) Text in Cell D2 --> display that text in Cell E1
3) Both Cells D1 and D2 are empty --> do nothing

I would like to place a formula in Cell E1 that will display the text in whichever cell (D1 or D2) has text (case 1 or 2), or just stays empty for Case 3.

'=IF(COUNTA(D1,D2),E1,"")' placed in cell E1 gives a circular reference error, but I have tired variations of this with no luck.

Thanks again.

David
OK, this should do what you want...

=IF(D1<>"",D1,IF(D2<>"",D2,""))
 
Upvote 0
Thanks! (There were only the 3 possible outcomes - the logic of all of the nested if statements provided that either D1 or D2 may have text, but not both.)
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,916
Members
448,533
Latest member
thietbibeboiwasaco

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