+ Reply to Thread
Results 1 to 7 of 7

Why is "" always greater in value?

Hybrid View

  1. #1
    Registered User
    Join Date
    05-31-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    7

    Question Why is "" always greater in value?

    I have a query where returning an IF statement with "" this "" seems to hold a greater value when using that value to compare 2 dates. In my test Excel file I've demonstrated how Cell D2 displays TRUE to the IF statement result of "" being greater than A2. I wonder if anyone can explain exactly how Excel treats the "" as despite the Cell value being blank its clearly always trumping any value being matched against it, I'd like to understand why Excel reacts this way, what exactly does "" represent if not blank? Is there an alternative to "" to have an IF statement to return the cell being blank and additionally holding no value?

    Thanks!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-31-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    7

    Re: Why is "" always greater in value?

    My current theory would be that "" equals a blank text value, so perhaps a text value even blank is greater no matter what? and that maybe "" should be replaced with 01/01/1900 and some conditional formatting to hide it? Any other solutions or explanations appreciated.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,955

    Re: Why is "" always greater in value?

    yes a text entry is always greater than any numeric entry
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Why is "" always greater in value?

    If you need the cell to display as empty but evaluate as less than other (positive) numbers, try using =IF(condition,something,0) instead of =IF(condition,something,""), then apply a custom format to it of 0;-0; (zero semicolon minus-zero semicolon). That will show any number normally unless it's zero, when it will show as blank.

    Hope that makes sense and is maybe of some help.

    ps Welcome to the forum.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  5. #5
    Registered User
    Join Date
    05-31-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    7

    Re: Why is "" always greater in value?

    Thanks for confirming my thoughts. I will go with the 01/01/1900 or a 0 and conditional formatting to resolve as this seems a good workable solution.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,955

    Re: Why is "" always greater in value?

    Happy to help, thanks for the feedback

  7. #7
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Why is "" always greater in value?

    Glad to help, thanks for the feedback and the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. IF function to return "YES" "NO" for greater than or less than
    By mattofthewoods in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-04-2014, 07:52 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] IF Formula not working - need to return "NO" if cell is 1% greater or "YES" if less 1%
    By maryren in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-26-2013, 11:34 AM
  4. [SOLVED] Cell Formula to count time with "Greater Than or Equal to" and "Less Than"
    By chriswhite1982 in forum Excel General
    Replies: 3
    Last Post: 06-16-2013, 12:30 AM
  5. Filter report in pivot table with "greater than" and "less than"
    By gygabyte017 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-29-2012, 08:08 AM
  6. Using DMIN to evaluate "less than" or "greater than" a specific date
    By williams485 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-01-2012, 12:45 PM
  7. countif + "greater than" "cell value" 2
    By vonPalm in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-21-2010, 02:42 AM

Tags for this Thread

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