How to reference / auto-populate different cells based on conditions that not every cell will have

mikeyates

New Member
Joined
Oct 17, 2023
Messages
23
Office Version
  1. 365
Platform
  1. Windows
I have a roster with first and last names. The next sheet is a sign in sheet. However, we are required to provide the option of preferred names instead of the legal first names.
For example, my name is Michael, but I go by Mike.
I still need the legal name for certification purposes, but need the preferred name on other things.

On the sign in sheet, it should automatically say Mike Yates instead of Michael. Can make it do it once, but I need a formula that can determine if there is a value in the preferred name field, and if not, defer to the first name.

I could just give everyone a preferred name, and make it their legal name if they don't specify one, but I'm not the only one who manages the spreadsheets, and I promise you it's either to magic happen with Microsoft than it is to get people to do take an extra step.

I keep getting an error with the xl2bb, so you'll have to live with snip-its.

1697658510588.png

1697658532112.png
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Do you mean like this:
Book1
ABC
3Preferred nameFirst nameLast name
4MikeMichaelYates
5OzzieSmith
6
7
8NameDatesignatutre
9Mike Yates
10Ozzie Smith
Sheet1
Cell Formulas
RangeFormula
A9:A10A9=IF(A4<>"",A4&" "&C4,B4&" "&C4)
 
Upvote 1
Solution
Yes! Just so I'll understand it, is the <> implying value? Saying, IF A4 has value, then A4&C4, otherwise B4&C4?
Does that work in other formulas that I may need to infer value?
 
Upvote 0
Hi Mike, <> means 'is not equal to' and "" equates to an empty string - combining the two means 'does not equal an empty string' or in other words, contains a string (of any length).
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,970
Members
449,095
Latest member
Mr Hughes

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