Forum Discussion

markzullig's avatar
markzullig
Copper Contributor
Aug 23, 2024

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

  • markzullig 

    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.

     

  • markzullig 

    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.

     

    • markzullig's avatar
      markzullig
      Copper Contributor
      The 1st function worked. The 2nd one resulted in #NAME?. Not sure why.

      I'll be using the 1st one from here on out.

      Thanks
      • PeterBartholomew1's avatar
        PeterBartholomew1
        Silver Contributor

        markzullig 

        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.

  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor
    Question 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.

Resources