+ Reply to Thread
Results 1 to 8 of 8

Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'name'

  1. #1
    Registered User
    Join Date
    08-25-2015
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'name'

    I am trying to compare 3 cells to determine the lowest value, and in the fourth cell, return a prompt of the name of the column with the lowest value. Basically something like this:

    CELL A1 = "Company A" , CELL B1 = "Company B" , CELL C1 = "Company C", CELL D1 = "BEST PRICE"
    CELL A2 = $4 , CELL B2 = $5, CELL C2 = $6, CELL D2 = "Company A"

    I've tried using IF(AND, , ) but I cannot figure out the correct syntax.

    ANYONE KNOW HOW TO DO THIS?
    Last edited by dtufts; 08-25-2015 at 06:13 PM.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'n

    Try this...

    Data Range
    A
    B
    C
    D
    E
    1
    Company A
    Company B
    Company C
    ------
    Lowest
    2
    3.0
    3.4
    3.2
    Company A


    This formula entered in E2:

    =INDEX(A1:C1,MATCH(MIN(A2:C2),A2:C2,0))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'n

    Try this:

    =INDEX(A$1:C$1,MATCH(MIN(A2:C2),A2:C2,0))

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    08-25-2015
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'n

    That works perfectly, thanks so much!

  5. #5
    Registered User
    Join Date
    08-25-2015
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'n

    Another question: How would I get the MODE of the outcomes in column E (as shown by Biff's post) the most occurring best price company?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'n

    Do you mean if multiple companies had the lowest price then list each company?

  7. #7
    Registered User
    Join Date
    08-25-2015
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'n

    No. I have a long list of items, of which 3 company's prices were compared for each item. The result per item is one company with the lowest price. Since I am comparing multiple items, company A is not always the cheapest. Therefore, once I have compared all the items, I have a column of results that are either company A, B, or C. Now I would like to run a formula on that column to see which company showed up most frequently with the lowest price.

    If you look at Biff's table above; imagine there being rows 2-200 (items), with pricing from each company within columns A, B and C. With column E showing the cheapest company for each item (or row), I would like to now run a formula on column E to see which result showed most frequently. Make sense?

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Nested IF THEN, AND -comparing 3 cells to determine the lowest value, and returning 'n

    Try this...

    Data Range
    E
    F
    G
    1
    Lowest
    ------
    Most Often
    2
    Company A
    Company B
    3
    Company A
    4
    Company B
    5
    Company B
    6
    Company B
    7
    Company B
    8
    Company C
    9
    Company C
    10
    Company C


    This array formula** entered in G2:

    =INDEX(E2:E10,MODE(MATCH(E2:E10,E2:E10,0)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    I have the companies sorted just to make it easier to see which appears most often.

+ 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] Comparing two columns and returning the number of cells in one column with higher values
    By heresteve2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2014, 01:06 PM
  2. Nested IF function returning N/A for some cells
    By leafs4life22 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-01-2013, 02:14 AM
  3. [SOLVED] Comparing two cells and returning a text value
    By meminto in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-06-2013, 06:28 PM
  4. Nested IF statement comparing value1 against multiple cells?
    By MJSlattery in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2012, 06:12 PM
  5. Replies: 7
    Last Post: 04-19-2011, 04:01 PM
  6. Returning different values when comparing 2 cells
    By Carl1966 in forum Excel General
    Replies: 1
    Last Post: 09-09-2008, 08:15 AM
  7. Formula to determine lowest 5 of 7 values?
    By acjcanada in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-11-2008, 10:41 AM

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