+ Reply to Thread
Results 1 to 16 of 16

2 colums of data, trying to specify cheapest one of groups by matching names

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    2 colums of data, trying to specify cheapest one of groups by matching names

    Hello,

    I'am trying to see if it is possble to, with the attached data, that is sorted by "variant name" (column A) asside from the spaces, look through column A to find groups of "variant names" that are the same, then compare the prices (column c) of these rows in the "variant name" groups and in column B enter yes for the cheapest one of the "variant name" group and no for the rest.

    Considering that in some "variant name" groups the prices may all be the same and then it would not matter which one was selected the first one down the list or last is as good as any if thats easiest or also there may be several different prices for items in the "variant name" groups but there may be more than one of them that are the cheapest price, again it would not matter which one was made to be yes in colum B of these matching cheapest prices with in a "variant name" group but - only 1 of any "variant name" group can be yes the rest have to be no.

    This is a bit complicated, but I hope it makes sense. Hopefully this is possible, but I dont have the excel skills to be able to knock up the code required to do this.

    I hope someone can help.

    Best regards,

    Paul
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-27-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    198

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Try this code:
    Please Login or Register  to view this content.
    Last edited by xLJer; 08-11-2012 at 05:32 PM.

  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
    53,048

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    take a look at this thread, it appears to be similar to what you want

    edit: guess it would help if i attached the link?

    http://www.excelforum.com/excel-gene...html?p=2882619
    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 Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    This is my interpretation of your problem.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    This formula, array-entered (press CTRL+SHIFT+ENTER)
    into say, D2:
    =MIN(IF($A$2:$A$2500=A7,$C$2:$C$2500))
    would return the lowest price in col C for the product description in col A

    To flag it out as desired,
    you could use this IF in E2, copied down:
    =IF(C2=D2,"Yes","")
    Max
    Singapore

  6. #6
    Forum Contributor
    Join Date
    07-27-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    198

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    To expand on the post from Max, you don't want to have any Yes or No on rows where Variant Title is blank. With the array
    formula in D2, the formula in B2 to display either "Yes" or "No" would be:
    Please Login or Register  to view this content.
    I think Max may have intended to type "A2" instead of "A7" in his array formula example.
    Jerry

  7. #7
    Registered User
    Join Date
    08-07-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Hello,

    Thank you very much for looking at this problem for me.

    Max and xljer - This works very well though I get "yes" coming up for all rows in a group that are the cheapest rather than just one of them even if both of them are the cheapest. or all of them are the same price.

    Jindon - your button version works almost perfectly, where the variant title colum entries are blank it would be good to have nothing entered in the column B, though this is not a major problem. I need to be able to transfer this marco or formula to a much larger spreadsheet of data, is there anyway this button version could be made like a module that could be called into action by entering a function into a column? or as a key stroke?

    Thank you everyone for your help so far this is very helpful.

    Paul

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Key : Ctrl + BackSpace

    To ThisWorkbook module
    Please Login or Register  to view this content.
    To a Standard Module
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-07-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Hi jindon,

    This is perfect, thanks very much for this exactly what I needed.

    Thanks once again.

    Paul

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    That's good and thanks for the feed back.

  11. #11
    Registered User
    Join Date
    08-07-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Hi Jindon,

    I'm just trying to impliment the code you created on my main spreadsheet and I'm trying to change the code to tell it where the relevant data is and the a, b, c, columns of the spreadsheet I uploaded with example data I need to change to v, ab, ao, respectively. I think I can see where to change the a and b column references but cant see where the c colum is referenced from the code, could you help with that at all? I've made the below edit, but it doesnt work due to my above problem, hope you can help.

    Please Login or Register  to view this content.
    Hope you can help and look forward to hearing from you.

    Thanks and best regards,

    Paul

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Try replace all a(i, 3) with a(i, 15)

  13. #13
    Registered User
    Join Date
    08-07-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Thanks again Jindon.

    All working fine perfectly now.

    Cheers,

    Paul

  14. #14
    Registered User
    Join Date
    08-07-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Hi,

    I'm having some problems trying to use the above module in a different spread sheet. I have the below where column Y has the titles in, column AN is where I want the yes or no answers and column BD is the column with the prices that need comparing.

    Please Login or Register  to view this content.
    The spread sheet i'm trying to apply this too has over 5200 rows, when I apply this it makes the calculation and inserts Yes's and No's though it either puts them as the first of a group(in Y column) or the (second row in a group) and this changes every time I re-do the calculation even if I make no changes to the workbook module.

    Any help with this would be gratefully received.

    Cheers.

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Change to a(i, 32)

  16. #16
    Registered User
    Join Date
    08-07-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: 2 colums of data, trying to specify cheapest one of groups by matching names

    Hi jindon,

    That sorted it out thanks very much.

+ 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