If two different cells not equal to a text value display the text value in a different

rdoulaghsingh

Board Regular
Joined
Feb 14, 2021
Messages
105
Office Version
  1. 365
Platform
  1. Windows
I have two cells A1 and B2 which contain the default text<Customer Name>. If either of the two cells (one or the other) contain anything other than "<Customer Name>" I want the text to be displayed in another cell K14.
Below is the excel function I have in K14, but I'm missing something. I tried using the OR operator as well, but that doesn't give me the correct output either. I'm also wondering if there is an additional syntax I can add to the function so if one of the two cells with <Customer Name> gets deleted, it doesn't give an #REF! error. Please help!

=IF(AND(A1<>"<Customer Name>",B1<>"<Customer Name>"), A1, B1)
 
Is it possible to retain column B also if column A is deleted instead of showing blank?

Since we're only dealing with 2 cells, we can use the Volatile function INDIRECT without any performance issues:

Excel Formula:
=IFERROR(IF(A1<>"<Customer Name>",A1,IF(B1<>"<Customer Name>",B1,"")),INDIRECT("a1"))
 
Upvote 0
Solution

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Since we're only dealing with 2 cells, we can use the Volatile function INDIRECT without any performance issues:

Excel Formula:
=IFERROR(IF(A1<>"<Customer Name>",A1,IF(B1<>"<Customer Name>",B1,"")),INDIRECT("a1"))
Many thanks for your support!
 
Upvote 0
You're welcome, thanks for the feedback.
Sorry to be a bother. I tried the function as shown below, but when the page with the one of the cells gets deleted it still gives Ref error. Any parting pointers?

=IFERROR(IF('Introduction 800-171'!B15<>"<Customer Name>",'Introduction 800-171'!B15,IF('Introduction CMMC'!B15<>"<Customer Name>",'Introduction CMMC'!B15,"")),INDIRECT('Introduction 800-171'!B15))
 
Upvote 0
My solution in Post #11 works if the 2 cells in question are on the Same sheet And Next to each other, as you described.
The formula as it is, will Not work if the 2 cells are in Different sheets.

Since you started a new thread, I'll post my answer there.
 
Upvote 0

Forum statistics

Threads
1,215,528
Messages
6,125,342
Members
449,218
Latest member
Excel Master

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