+ Reply to Thread
Results 1 to 9 of 9

Return result based on the lowest value, but higher than 0

  1. #1
    Registered User
    Join Date
    03-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Return result based on the lowest value, but higher than 0

    Hello,

    I have 3 columns, let's call them "Cat", "Dog" and "Rat". For each column I have values, and the base value is 0.

    I'm trying to get a formula to show me "Cat", "Dog" or "Rat" based on the lowest value, but higher than 0.

    The formula I have so far is:
    =IF(AND(A5<B5,A5<C5),"Cat",IF(AND(B5<A5,B5<C5),"Dog",IF(AND(C5<A5,C5<B5),"Rat","No")))

    This keeps returning anything that is 0. And the "No" would indicate that it is 0 of each. I have tried a few other variations of this too, but I'm not getting anywhere fast.

    Also, What if Cat and Dog are both the same value. Is there a way I can have it return "Cat/Dog" or something?

    I would be forever grateful for some help on this.
    Last edited by zbor; 06-01-2012 at 02:39 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Growing IF Command - Help Required

    Hi Cowproduct,

    Try using below formula to return either cat/dog/rat :-

    =IF(MIN(A5,B5,C5)=A5,"Cat",IF(MIN(A5,B5,C5)=B5,"Dog","Rat"))

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    03-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Growing IF Command - Help Required

    Unfortunately no, I just tried this and it also reverts to the 0.
    If I say 2 dog, 1 cat, 0 rat, it should give me cat as the result. But it gives me rat again...

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Growing IF Command - Help Required

    Oopss.. I got it..
    Suggest you to upload a sample file with multiple scenarios you have.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    03-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Growing IF Command - Help Required

    Ok, I've attached it with some sums and your formula, as well as what the outcome should be.

    If it needs to be across 3 columns with conditional formatting, that's fine too...
    Attached Files Attached Files

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Growing IF Command - Help Required

    It's long maybe someone can help shorten this up.

    Please Login or Register  to view this content.
    array formula - ctrl + shift + enter
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  7. #7
    Registered User
    Join Date
    03-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Growing IF Command - Help Required

    Brilliant! Thanks for that. Works a treat.
    Only issue is the unsightly spaces. But I will just paste the values and replace spaces. Thank you!

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,603

    Re: Growing IF Command - Help Required

    How about this:

    =INDEX($A$4:$C$4,MATCH(LARGE($A5:$C5,COUNTIF($A5:$C5,">0")),$A5:$C5,0))

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,603

    Re: Return result based on the lowest value, but higher than 0

    Also, I've changed your title this time but next time I'll close a thread.

    Why you wonder? Check the Rule number 1

+ 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