+ Reply to Thread
Results 1 to 7 of 7

Using vlookup sort one column into multiple columns

  1. #1
    Registered User
    Join Date
    11-02-2018
    Location
    Cardiff
    MS-Off Ver
    16.16.3
    Posts
    3

    Question Using vlookup sort one column into multiple columns

    Hi All,

    This is my first post and I have limited excel knowledge so apologies if this question has been answered somewhere else already. I am just getting to grips with the excel terminology so searching is rather difficult when you don't know how to correctly describe your problem

    I have attached an example of what I am trying to do on a much larger scale. I receive a download from a supplier of options/items purchased by customers separated into anonymised single row entries. I then need to convert this into a table so I can see all the customers who have purchased Item A, Item B, Item C, etc. in separate columns to later sort and filter them.

    I can do this the long way by separating them out into a table of all entries of a specific item type and if vlookup in that table is true, a value is returned. This takes extra time to set up and process and I would rather have a forumla in each column that reads something along the lines of:

    =IFERROR(IF(VLOOKUP(A2,Download,2,0)="A","A",""),"")
    =IFERROR(IF(VLOOKUP(A2,Download,2,0)="B","B",""),"")
    =IFERROR(IF(VLOOKUP(A2,Download,2,0)="C","C",""),"")
    etc.

    The problem with this is it stops after the first vlookup entry that relates to that customer rather than continuing to check all entries relative to that customer to see if the formula is true further down. How do I get it to continue this process or work around this limitation of vlookup functions.

    Thanks in Advance,
    TMAC
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Using vlookup sort one column into multiple columns

    Welcome to the forum!

    Please clarify which version of Excel you have - if 2016, you have Get & Transform. The attached is done with that - let me know if you will need directions about how it's done.
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Using vlookup sort one column into multiple columns

    Please try at B2 and copy over the table

    =IF(SUMPRODUCT(--($A2&RIGHT(B$1)=INDEX(Download,,1)&INDEX(Download,,2))),RIGHT(B$1),"")

  4. #4
    Registered User
    Join Date
    11-02-2018
    Location
    Cardiff
    MS-Off Ver
    16.16.3
    Posts
    3

    Re: Using vlookup sort one column into multiple columns

    Hi all,

    Thank you for the help.

    By replacing the Red with "Item name" and the Green with "Abrieviated item name", I am able to process the information at the same time.

    By adding the whole formula again in the Blue section of the formula I have been able to add e.g "Basic" or "Premium" as final item names in the same output column to determine levels of the same item.

    =IF(SUMPRODUCT(--($A2&RIGHT(B$1)=INDEX(Download,,1)&INDEX(Download,,2))),RIGHT(B$1),"")

    This has made my day so much quicker, I cannot thank you all enough!

    TMAC

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Using vlookup sort one column into multiple columns

    Glad you are sorted, but did you bother to look at what I provided at all? Would be nice to know, one way or the other.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  6. #6
    Registered User
    Join Date
    11-02-2018
    Location
    Cardiff
    MS-Off Ver
    16.16.3
    Posts
    3

    Re: Using vlookup sort one column into multiple columns

    Hi Ali,

    The solution you provided was another great solve but it requires an extra step compared to the formula Bo provided. Thanks for the help though as for a quick solution your method is perfect.

    All the best,
    TMAC.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Using vlookup sort one column into multiple columns

    It only requires setting up once. After that you just refresh the query each time you add data to the source table and the results table will update automatically.

+ 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. Replies: 1
    Last Post: 03-29-2018, 07:58 AM
  2. Sort multiple columns by one column until BLANK, then REPEAT
    By Tamichan5 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2017, 09:06 PM
  3. sort data base on one column to multiple columns
    By typerxtreme in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-24-2013, 11:39 AM
  4. Sort multiple columns to one column, skip blanks
    By AlexCoyne in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-20-2013, 03:13 PM
  5. [SOLVED] Sort multiple columns based on column header
    By Langer101 in forum Excel Programming / VBA / Macros
    Replies: 39
    Last Post: 01-09-2013, 09:55 AM
  6. [SOLVED] Sort by the multiple of 2 columns without making another column?
    By niko79542 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2012, 09:46 AM
  7. Replies: 1
    Last Post: 12-20-2010, 06:30 PM

Tags for this Thread

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