Forum Discussion
How to put formatted text in one cell when another cell value is blank
How to put formatted text in one cell when another cell value is blank.
In one column I have phone numbers. For the cells that don't have a phone number (G1), I want another cell in the next column (H1) to automatically put the text "Record Not Clean"?
How do I do this? Is there a certain function that allows me to do this?
Thanks
You can test whether the phone number is present using
= IF(ISNUMBER(phone), "", "Record not clean")
Using modern Excel, a more precise test might be
= IF(REGEXTEST(phone, "^\d{10}|\d{7}$"), "", "Record not clean")
which requires 7 or 10 digit numbers.
- PeterBartholomew1Silver Contributor
You can test whether the phone number is present using
= IF(ISNUMBER(phone), "", "Record not clean")
Using modern Excel, a more precise test might be
= IF(REGEXTEST(phone, "^\d{10}|\d{7}$"), "", "Record not clean")
which requires 7 or 10 digit numbers.
- markzulligCopper ContributorThe 1st function worked. The 2nd one resulted in #NAME?. Not sure why.
I'll be using the 1st one from here on out.
Thanks- PeterBartholomew1Silver Contributor
That's not your fault. The regular expression functions are currently being rolled out (insider beta channel) so it is unlikely that you will have them yet. My apologies for that.
- Harun24HRBronze ContributorQuestion is not clear enough. You may try IF() or MATCH() function. You may also need combination of few other functions. Post few sample data and show your expected output.