+ Reply to Thread
Results 1 to 5 of 5

IF(A cell has anything in it)

  1. #1
    Registered User
    Join Date
    08-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    IF(A cell has anything in it)

    Should be an easy one.

    Is there any command usable in an IF statement that checks to see if a cell has a value or text in it? Like IF(A1="text or number", YES, NO). Tried both text and value but those are converters.

    If not then I guess I'll do things the hard way and make a ton of IF statements within each other.

  2. #2
    Valued Forum Contributor
    Join Date
    09-23-2005
    Location
    Bristol, UK
    MS-Off Ver
    2007
    Posts
    664

    Re: IF(A cell has anything in it)

    Hi there,

    You can use the ISTEXT (the cell contains a text value) or ISNUMBER (the cell contains a numeric value) functions. This returns a boolean TRUE or FALSE. So, if your data is in column A, just do =ISTEXT(A1) (or =ISNUMBER(A1) dependent on which you prefer then drag down.

    If you want something more than TRUE and FALSE - e.g. "Yes","No" - then do: =IF(ISTEXT(A1),"Yes","No").

    HTH,

    SamuelT

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: IF(A cell has anything in it)

    Sounds like you just want to see if it's not blank... so either

    =IF(A1<>"","Yes","No")

    or

    =IF(COUNTBLANK(A1),"No","Yes")

    (note COUNTA unlike COUNTBLANK would interpret a formula null as non-blank)

  4. #4
    Valued Forum Contributor
    Join Date
    09-23-2005
    Location
    Bristol, UK
    MS-Off Ver
    2007
    Posts
    664

    Re: IF(A cell has anything in it)

    Quote Originally Posted by DonkeyOte View Post
    Sounds like you just want to see if it's not blank...
    Agreed - I misread the post!

  5. #5
    Valued Forum Contributor
    Join Date
    07-21-2008
    Location
    London, UK
    Posts
    326

    Re: IF(A cell has anything in it)

    If you want some VBA to play with :
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1