+ Reply to Thread
Results 1 to 13 of 13

Blank cells in a formula

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    Spokane WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Blank cells in a formula

    If the cell(G32) is left blank it returns a "yes " when I want it to say "no". What am I missing here.

    =IF(G32>=7.25,"Yes","No")

    Thank you for your help

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Blank cells in a formula

    Your formula seems to work for me... but you could also try this:

    =IF(OR(G32<7.25,G32=""),"No","Yes")

    Will return "No" if G32 <7.25 or if G32 is blank.
    Will return "Yes" if G32 >= 7.25

    - Moo
    Last edited by Moo the Dog; 01-24-2013 at 05:42 PM.

  3. #3
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Blank cells in a formula

    If the contents of G32 was not Deleted,
    but Spaced Over,
    then you will get a YES,
    because G32 is NOT blank.

  4. #4
    Registered User
    Join Date
    09-11-2012
    Location
    Spokane WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Blank cells in a formula

    Moo
    I tried the formula that you wrote and I still get a yes. The formula works only when a number is in the cell, if it is blank it returns a yes.

  5. #5
    Registered User
    Join Date
    01-24-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Blank cells in a formula

    Include checking if it's a text, i.e.: if(cell("type",G32)="l","NO",IF(G32<7.25,"No","Yes"))

  6. #6
    Registered User
    Join Date
    09-11-2012
    Location
    Spokane WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Blank cells in a formula

    xenixman
    There are no contents in the cell until i in put a number, then I get the correct result. It is when I t select the cell and clear it,that is when I still get a yes.

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Blank cells in a formula

    Quote Originally Posted by Jdhouse View Post
    Moo
    I tried the formula that you wrote and I still get a yes. The formula works only when a number is in the cell, if it is blank it returns a yes.
    Sounds like you have something other than a blank in G32 - is there a formula in that cell, what's the formula?

    Try using N function to extract the number, i.e.

    =IF(N(G32)>=7.25,"Yes","No")
    Audere est facere

  8. #8
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Blank cells in a formula

    See my attached sheet. Both formulas seem to work correctly. Are you positive the cell is truly empty, as xenixman stated? One way to check is to type this into another cell: =ISBLANK(G32)

    If that returns TRUE, then it is blank, if it returns FALSE, there is something in the cell.

    - Moo
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-11-2012
    Location
    Spokane WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Blank cells in a formula

    daddylonglegs


    That seems to work , Thank you.
    What does the "N" do ?
    In my formula what happens when I clear the cell using the space bar that allows the formula to return a yes?

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Blank cells in a formula

    Quote Originally Posted by Jdhouse View Post
    In my formula what happens when I clear the cell using the space bar that allows the formula to return a yes?
    If you do that you are putting a space in the cell - a space is a text value....and any text value is deemed to be greater than any number. Better to use "backspace".

    N extracts the number from a numeric value but returns zero if the cell contains text or any non-numeric value, e,g, =N(9) = 9 but =N("x")=0

  11. #11
    Registered User
    Join Date
    09-11-2012
    Location
    Spokane WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Blank cells in a formula

    I would have never known that. Thank you very much.
    Is the N a function or ? How could have found that ? Help Manual ? Or "should have stayed in school"
    Thank you again.

  12. #12
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Blank cells in a formula

    I've read about people who use the spacebar to "clear" out a cell, but until now, have never run into one. First time for everything.

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Blank cells in a formula

    Quote Originally Posted by Jdhouse View Post
    Is the N a function or ? How could have found that ? Help Manual ?
    Yes, it's a function but not a very well known function - Excel help says "it's provided for compatability with other spreadsheet programs" (Lotus?)

    You could also use SUM to do the same because again =SUM(A1)=9 when A1 = 9 but = 0 when A1 = "x"

+ 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