+ Reply to Thread
Results 1 to 6 of 6

MIN() with IF() inside return #VALUE!

  1. #1
    Registered User
    Join Date
    04-15-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    3

    MIN() with IF() inside return #VALUE!

    Hi, I just have a minor problem with the MIN function while having an IF function inside.

    To make it simple I have used this simplified equation for example.


    In Excel if I use this formula it will return #VALUE!

    =MIN(IF(1>0,2,""),IF(1<0,2,""))


    But if I have

    Cell A1 = IF(1>0,2,""), Cell A2 = IF(1<0,2,"")

    Then if I take the MIN of A1:A2 it will return 2


    Why is Excel returning #VALUE! for my first formula? I think it is assume "" as a string and not returning a blank.

    Could someone please help me solve this problem?

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: MIN() with IF() inside return #VALUE!

    That's exactly whats happening..

    See if this helps!

    =MIN(IF(1>0,2,10^99),IF(1<0,2,10^99))
    Cheers!
    Deep Dave

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: MIN() with IF() inside return #VALUE!

    Quote Originally Posted by awhc View Post
    I think it is assume "" as a string and not returning a blank.
    Yes exactly...

    Because you are evaluating a string without any Number in a single argument.

    =MIN(2,"")

    Will not result #Value Error in this case
    =MIN(2,{200,""})

    Actually why you need mininum in this case? When it can be written in the below way?

    =OR(1>0,1<0)*2


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    04-15-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    3

    Re: MIN() with IF() inside return #VALUE!

    Quote Originally Posted by NeedForExcel View Post
    That's exactly whats happening..

    See if this helps!

    =MIN(IF(1>0,2,10^99),IF(1<0,2,10^99))
    I did think of using a very large number, which solves the problem. But if someone was to look at my spreadsheet again they might be confused why I put such a large number in the FALSE statement.

    Quote Originally Posted by :) Sixthsense :) View Post
    Yes exactly...

    Because you are evaluating a string without any Number in a single argument.

    =MIN(2,"")

    Will not result #Value Error in this case
    =MIN(2,{200,""})

    Actually why you need mininum in this case? When it can be written in the below way?

    =OR(1>0,1<0)*2
    I am just confused why if I put the IF() in separate cells it will return a blank, but when it is inside MIN() it will return the string "".

    My actually formula involves vlookup.

    =MIN(IF(F3="S",VLOOKUP(B3,Table1,3,FALSE),""), G3="S",VLOOKUP(C3,Table1,3,FALSE),""), H3="S",VLOOKUP(D3,Table1,3,FALSE),""), I3="S",VLOOKUP(E3,Table1,3,FALSE),""))

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,631

    Re: MIN() with IF() inside return #VALUE!

    Please Login or Register  to view this content.


    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    04-15-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    3

    Re: MIN() with IF() inside return #VALUE!

    ProtonLeah

    If my IF() is FALSE it will return 0 and if my lowest value from the VLOOKUP is above 0 then I will not be able to capture the lowest value I was after from Table1

+ 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. [SOLVED] How to restrict pop of message box inside multiple times when it is inside a for loop?
    By timmu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2014, 06:00 AM
  2. [SOLVED] Help with an IF inside an IF..
    By andrewbutler1986 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 02-07-2014, 12:29 PM
  3. Replies: 9
    Last Post: 09-25-2013, 06:26 PM
  4. Return a worksheet name inside a formula
    By kavehmj in forum Excel General
    Replies: 7
    Last Post: 10-26-2012, 01:31 PM
  5. Replies: 1
    Last Post: 10-02-2012, 04:27 PM

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