+ Reply to Thread
Results 1 to 9 of 9

Vlookup query - looking up from a horizontal table to deliver numbers to a vertical table

  1. #1
    Forum Contributor
    Join Date
    07-22-2015
    Location
    San Francisco
    MS-Off Ver
    Mac 2011 Version 14.5.2
    Posts
    107

    Vlookup query - looking up from a horizontal table to deliver numbers to a vertical table

    Hello,

    I have a table (see attached) where there is a horizontal table with two date rows and a row showing the number of units of equipment.

    I have a second table that is the same as the first table, but it is vertical.

    I am trying to drop the number of units from the horizontal table next to the corresponding date in the identical vertical table.

    Would anyone be able to help with this? I believe I may need to use a combination of Vlookup and Hlookup, but my attempts have been unsuccessful.

    Any help much appreciated.

    Many thanks!
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup query - looking up from a horizontal table to deliver numbers to a vertical ta

    Hi adam,

    F5 copied down =INDEX($F$3:$BM$3,MATCH(D5&"|"&E5,$F$1:$BM$1&"|"&$F$2:$BM$2,0))

    IMPORTANT
    • This is an array formula
    • Enter the formula >> press F2 then >> CTRL + SHIFT + ENTER
    • If entered correctly, the formula will be enclosed in {brackets}
    • Do not enter the {brackets} manually

    or a non array option...

    =SUMPRODUCT(--($F$1:$BM$1=D5),--($F$2:$BM$2=E5),$F$3:$BM$3)
    Last edited by jeffreybrown; 02-21-2017 at 08:30 PM.
    HTH
    Regards, Jeff

  3. #3
    Forum Contributor
    Join Date
    07-22-2015
    Location
    San Francisco
    MS-Off Ver
    Mac 2011 Version 14.5.2
    Posts
    107

    Re: Vlookup query - looking up from a horizontal table to deliver numbers to a vertical ta

    Hi Jeff,

    I am sure this is my mistake, but when I copy the cells down and across it gives the same values in column F.

    Columns G to BM have #N/A.

    Any ideas wha

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup query - looking up from a horizontal table to deliver numbers to a vertical ta

    Hi Adam,

    You have units in F3:BM3 and you want to take those units and transfer them from F5:F64. Is this correct?

    If it is correct, in F3 paste =SUMPRODUCT(--($F$1:$BM$1=D5),--($F$2:$BM$2=E5),$F$3:$BM$3) and then copy it down to F64.

    Maybe an easier way and not having to mess with a formula, copy F1:BM3 and then pick a spot where you want it and right click, paste special transpose

  5. #5
    Forum Contributor
    Join Date
    07-22-2015
    Location
    San Francisco
    MS-Off Ver
    Mac 2011 Version 14.5.2
    Posts
    107

    Re: Vlookup query - looking up from a horizontal table to deliver numbers to a vertical ta

    I am trying to have the units in row 3 correspond to the correct date vertical and horizontal date reference.

    So, for example the 3 units in P3 would get dropped into cell P15 (lining up with the vertical and horizontal date of 1/11/17.

    Is that possible?

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup query - looking up from a horizontal table to deliver numbers to a vertical ta

    Quote Originally Posted by adam_d_john View Post
    Is that possible?
    Yes, see if this example works for you.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    07-22-2015
    Location
    San Francisco
    MS-Off Ver
    Mac 2011 Version 14.5.2
    Posts
    107

    Re: Vlookup query - looking up from a horizontal table to deliver numbers to a vertical ta

    Hi Jeff,

    In this file all the numbers are going down column F, but it returns 0's to the other columns. What I am trying to do is have one value only returned to each column. Because each number with be aligned with the same date (from the vertical and horizontal axis) the numbers will be perfectly diagonal from top left to bottom right.

    Do you know what I mean? I could do it manually, but I will need to change these numbers and therefore need to automate it.

    Many thanks,
    Adam

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: Vlookup query - looking up from a horizontal table to deliver numbers to a vertical ta

    Try this in F5:

    =IF(AND(F$1=$D5,F$2=$E5),F$3,"")

  9. #9
    Forum Contributor
    Join Date
    07-22-2015
    Location
    San Francisco
    MS-Off Ver
    Mac 2011 Version 14.5.2
    Posts
    107

    Re: Vlookup query - looking up from a horizontal table to deliver numbers to a vertical ta

    That works Phuocam!

    Thankyou very much to everyone for helping me with this.

    All the best!

+ 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] Transpose horizontal table to a vertical table via query
    By Journeyman3000 in forum Access Tables & Databases
    Replies: 5
    Last Post: 12-03-2015, 10:21 PM
  2. 3 criteria for horizontal and vertical matching from a table
    By mator in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-24-2014, 06:28 AM
  3. [SOLVED] How to get a result from a table (vertical+horizontal)
    By Loreleii7 in forum Excel General
    Replies: 4
    Last Post: 09-09-2014, 10:54 AM
  4. [SOLVED] Horizontal and vertical VLOOKUP in a table
    By Bax in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-27-2014, 07:10 AM
  5. [SOLVED] Turning a Vertical Table into a Horizontal one
    By Rob8489 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-11-2013, 10:03 AM
  6. [SOLVED] Reformat vertical table to a horizontal table
    By roversfan09 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-25-2013, 12:28 AM
  7. Reformat a vertical data set to a horizontal table
    By zenmeta4 in forum Excel General
    Replies: 2
    Last Post: 06-04-2009, 03:55 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