+ Reply to Thread
Results 1 to 4 of 4

Compare multiple columns for match then give MIN

  1. #1
    Registered User
    Join Date
    07-17-2014
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    6

    Compare multiple columns for match then give MIN

    Good Morning & Happy Thursday

    IF,COUNTIF,INDEX,MATCH,VLOOKUP = MY WORST ENEMY!!! I've been stuck on this for days and have given up so I'm hoping someone can please review and offer help or suggestions on how I can make this work please!

    My overall worksheet is almost 3000 rows. Throughout columns A and B are matches - where their difference is column C (price). I need to add a formula to column D that checks column A and B for a match and if they match then compare the prices for the match and return in column D the MIN with a "True" or "False". If there are no matches (only one entry exists) then I want it to return the price (column C) since that is the MIN as there is only one!

    Here's an example. I've highlighted to show the different scenarios and I've manually typed in the MIN PRICE (column D) to show the desired outcome.

    Blue highlight: A2:B2 match A3:B3 so compare C2:C3 for MIN and return value to Column D
    Yellow highlight: A4:B4 match A5:B5 so compare C4:C5 for MIN. A6:B6 has no match so return "True" since it's the only item.
    Pink highlight: A7:B7 no matches, A8:B8 no matches, A9:B9 no matches so return "True" on all three rows since it's the only item.

    The idea here:
    There's way more to this worksheet than what is shown. The price (column C) can change depending on the discount. Some of the UDAC (column B) fields are locked from formulas in other columns not seen here that does not allow discounting thus their price will never change. As discounts are added I need it to always give me the row that is the best price for the client without offering the same item twice. So example - reviewing rows 2 and 3....C3 is actually a locked price - no changes will ever occur. C2 can change based on a percent off that I already have established in the worksheet. Currently you see C2 is $100 and C3 is $50. If I apply a higher discount and C2 becomes $25 and C3 is $50....I would need D2 and D3 to recognize that D2 is now my MIN.


    I really hope that makes sense!
    Thanks so much in advance for reviewing & have a wonderful day
    Erin
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Compare multiple columns for match then give MIN

    1. give it a try
    2. Since it is not mentioned, the code first sorts the data by columns A & B

    Please Login or Register  to view this content.

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

    Re: Compare multiple columns for match then give MIN

    For formula.. since you are using 2010

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    or array entered

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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

  4. #4
    Registered User
    Join Date
    07-17-2014
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    6

    Re: Compare multiple columns for match then give MIN

    Both methods work beautifully!!!! THANK YOU BOTH SO VERY MUCH!!!! It always amazes me that there's a number of different ways to achieve desired results and I can't figure out one! Again, thank you Have a wonderful weekend!

+ 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. please help with compare two columns and give me result?
    By tomislav91 in forum Excel General
    Replies: 3
    Last Post: 01-24-2015, 02:48 PM
  2. Replies: 0
    Last Post: 10-21-2014, 06:52 AM
  3. Macro to Compare two columns and publish sheet name in case columns dont match
    By adaws in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2014, 01:21 PM
  4. [SOLVED] Compare two ranges of data and give unique values in two different columns ignoring blanks
    By rampulaparthi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2013, 04:17 PM
  5. how to compare multiple values and give error
    By krish T in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2010, 10:57 PM
  6. Compare 2 columns then give count
    By George4 in forum Excel General
    Replies: 27
    Last Post: 10-02-2008, 11:43 PM
  7. Compare two lists and give exact match
    By mccrimmon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2008, 07:46 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