+ Reply to Thread
Results 1 to 10 of 10

Horizontal and vertical criteria ranges + vlookup multiple conditions?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-14-2017
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    6

    Horizontal and vertical criteria ranges + vlookup multiple conditions?

    Hey guys,

    I would really appreciate som help on this problem.

    The workbook shows the structure of my database to the left, and to the right how i would like to restructure the data.

    The main problem is being able to transpose the data with multiple criteria ranges on date, id, segment and m.

    Anyone have any ideas? Im guessing that I will be needing some kind of multiple conditions vlookup, matrix or something like that.

    Best regards

    Lukas
    Attached Files Attached Files
    Last edited by lukasvjohansson; 07-14-2017 at 08:43 AM.

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

    Re: Horizontal and vertical criteria ranges + vlookup multiple conditions?

    Welcome to the forum!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-14-2017
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    6

    Re: Horizontal and vertical criteria ranges + vlookup multiple conditions?

    Thank you! I hope its a bit more clear now at least.

  4. #4
    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,050

    Re: Horizontal and vertical criteria ranges + vlookup multiple conditions?

    For the date column...
    =INDEX($A$3:$A$8,MATCH(J$1&" "&J$2,INDEX($B$3:$B$8&" "&$C$3:$C$8,0),0))
    copied down

    For the others...
    =INDEX($D$3:$E$8,MATCH(J$1&" "&J$2,INDEX($B$3:$B$8&" "&$C$3:$C$8,0),0),MATCH($H3,$D$2:$E$2,0))
    copied down and across
    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

  5. #5
    Registered User
    Join Date
    07-14-2017
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    6

    Re: Horizontal and vertical criteria ranges + vlookup multiple conditions?

    Quote Originally Posted by FDibbins View Post
    For the others...
    =INDEX($D$3:$E$8,MATCH(J$1&" "&J$2,INDEX($B$3:$B$8&" "&$C$3:$C$8,0),0),MATCH($H3,$D$2:$E$2,0))
    copied down and across
    This one works beautifully! Thanks a lot FDibbins.

    However, I think that I explained the date column wrong. What if I in the second table on the right already had the date for the specific ID. Then I would need to add another match argument, right?

    Hope you understand my question!

  6. #6
    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,050

    Re: Horizontal and vertical criteria ranges + vlookup multiple conditions?

    Quote Originally Posted by lukasvjohansson View Post
    This one works beautifully! Thanks a lot FDibbins.

    However, I think that I explained the date column wrong. What if I in the second table on the right already had the date for the specific ID. Then I would need to add another match argument, right?

    Hope you understand my question!
    Yes, you would need to include the extra criteria, it would go into the 1st MATCH....
    =INDEX($D$3:$E$8,MATCH(J$1&" "&J$2&" "&date-cell,INDEX($B$3:$B$8&" "&$C$3:$C$8&&" "&date-range,0),0),MATCH($H3,$D$2:$E$2,0))

  7. #7
    Registered User
    Join Date
    07-14-2017
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    6

    Re: Horizontal and vertical criteria ranges + vlookup multiple conditions?

    Thank you! I will try it out as soon as possible. My best try was using vlookup on multiple cells creating a lookup value for three criterias and then CHOOSE as table array.

  8. #8
    Registered User
    Join Date
    07-14-2017
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    6

    Re: Horizontal and vertical criteria ranges + vlookup multiple conditions?

    Something like this:
    Attached Files Attached Files

  9. #9
    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,050

    Re: Horizontal and vertical criteria ranges + vlookup multiple conditions?

    Quote Originally Posted by lukasvjohansson View Post
    Something like this:
    Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!

  10. #10
    Registered User
    Join Date
    07-14-2017
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    6
    Quote Originally Posted by FDibbins View Post
    Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!
    Great feedback, I was in a hurry. I will keep that in mind. Thank you!

+ 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
    By ravidesai in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-18-2016, 10:55 AM
  2. Sum with multiple criteria Horizontal and Vertical
    By freqzz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-26-2015, 04:39 AM
  3. Sum Multiple Criteria horizontal and vertical
    By baronk in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-16-2015, 07:55 AM
  4. Replies: 3
    Last Post: 06-12-2015, 10:33 AM
  5. Searching matching vertical and horizontal criteria in multiple sheets
    By Bloozntooz in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-14-2015, 04:12 PM
  6. [SOLVED] Summing Data with Multiple Criteria on Horizontal and Vertical Axis'
    By tlscowden in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-13-2015, 03:11 PM
  7. [SOLVED] Matching multiple criteria in two books, one data is horizontal, the other is vertical.
    By udrmichelle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-18-2015, 04:58 PM

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