+ Reply to Thread
Results 1 to 6 of 6

If cell has a value return "Y" if the cell is blank return "N"

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    If cell has a value return "Y" if the cell is blank return "N"

    Part 1:
    Two columns (A,B).
    Column A either has cells with values (including 0) or they are blank.
    I would like column B to return "Y" if the cells on the same row in column B has a value and "N" if it is blank.

    I am currentyl using =IF(A1>0,"Y","N")

    it returns "Y" for all cells including the blank cells.

    Part 2:
    Is there any way I can return a "Y" if the cell contains an interger (+ or -) and still return a "N" for blank cells?

    Thank you- Daniel

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: If cell has a value return "Y" if the cell is blank return "N"

    Hi Daniel,

    How about

    =IF(AND(N(A1),LEN(A1)>0),"Y","N")

    N >> checks to see if A1 is a number

    Len >> makes sure a value has been entered
    HTH
    Regards, Jeff

  3. #3
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: If cell has a value return "Y" if the cell is blank return "N"

    ISBLANK(A1) is a boolean function that returns TRUE if the cell (A1 in this case) has anything in it and FALSE if it's empty.

    ISNUMBER(A1) is similar (a boolean that checks what's in a cell), but it looks for whether the cell contains a number.

    Both are "information" type functions.

    If you want to check whether a cell contains an integer, as opposed to a real number, then I'd suggest something like, IF(A1-INT(A1) > 0, 'what do if true', 'what do if false') ; but someone else might know a more elegant approach.

    So ultimately:
    Please Login or Register  to view this content.
    That work???
    Last edited by ben_hensel; 05-07-2012 at 12:14 PM.

  4. #4
    Forum Contributor
    Join Date
    01-24-2011
    Location
    Sheppey
    MS-Off Ver
    Excel 2010
    Posts
    239

    Re: If cell has a value return "Y" if the cell is blank return "N"

    Try =IF(A1="","N","Y")

  5. #5
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: If cell has a value return "Y" if the cell is blank return "N"

    Jeff- success once again. Thank you - Daniel

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: If cell has a value return "Y" if the cell is blank return "N"

    You're very welcome Daniel…Thanks for the follow up and glad it worked for you.

+ 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