+ Reply to Thread
Results 1 to 7 of 7

HLOOKUP & VLOOKUP Combined

Hybrid View

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    Al Khobar, Saudi Arabia
    MS-Off Ver
    Excel 2010-2013
    Posts
    51

    HLOOKUP & VLOOKUP Combined

    I have a sheet in which the months are given in rows and there is another sheet in which I have to give the sum of certain products in the months columns which are aligned horizontally. Attached sheet for reference.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: HLOOKUP & VLOOKUP Combined

    Hi,

    You can use SUMPRODUCT:

    For your uploaded sample, formula in E3, copied down and across to G9:

    Formula: copy to clipboard
    =SUMPRODUCT(('Fruits Summary'!$B$3:$B$14=$D3)*('Fruits Summary'!$D$3:$D$14=E$2)*'Fruits Summary'!$C$3:$C$14)


    See attached.
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: HLOOKUP & VLOOKUP Combined

    Or with the more efficient SUMIFS

    =SUMIFS('Fruits Summary'!$C:$C,'Fruits Summary'!$B:$B,$D3,'Fruits Summary'!$D:$D,E$2)

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: HLOOKUP & VLOOKUP Combined

    Sumifs and Sumproduct is much efficient for numbers and here you wish a result as number so above two solutions are really good but if there is text result then I must say Index and Match combination would be good.

    An alternate solution try

    E3
    Formula: copy to clipboard
    =IFERROR(INDEX('Fruits Summary'!$C$3:$C$14,MATCH(E$2&$D3,INDEX('Fruits Summary'!$D$3:$D$14&'Fruits Summary'!$B$3:$B$14,),0)),"")


    Copy across
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,277

    Re: HLOOKUP & VLOOKUP Combined

    Instead of selecting complete column range, select range as per actual data range.
    Formula: copy to clipboard
    =SUMIFS('Fruits Summary'!$C$3:$C$14,'Fruits Summary'!$B$3:$B$14,'Combined List'!$D3,'Fruits Summary'!$D$3:$D$14,'Combined List'!E$2)


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: HLOOKUP & VLOOKUP Combined

    That is assuming that new data is not being added, otherwise the formula would need to be changed. Restricting the range is not necessary with SUMIFS unless slow performance is noticed, in which case dynamic named ranges would be the method of choice.

    For text results, this array formula would be more efficient than the array concatenation suggested in post 4

    =IFERROR(LOOKUP(2,1/IF('Fruits Summary'!$B$3:$B$14=$D3,'Fruits Summary'!$D$3:$D$14=E$2),'Fruits Summary'!$C$3:$C$14),"")

    Array confirmed with Shift Ctrl Enter

    best used with dynamic named ranges if more data is likely to be added at a leter point.

  7. #7
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: HLOOKUP & VLOOKUP Combined

    Jason Lookup function can handle array and there would be no need for CSE. Just modify as below. If you go with If condition it will definitely require CSE.

    Formula: copy to clipboard
    =IFERROR(LOOKUP(2,1/(('Fruits Summary'!$B$3:$B$14=$D3)*('Fruits Summary'!$D$3:$D$14=E$2)),'Fruits Summary'!$C$3:$C$14),"")

+ 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] Vlookup and Hlookup combined
    By concatch in forum Excel General
    Replies: 5
    Last Post: 07-07-2017, 09:31 AM
  2. Better formula than combined Vlookup & Hlookup
    By lozg43 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-20-2016, 03:30 PM
  3. [SOLVED] Vlookup, Hlookup or combined?
    By Dewdrop in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-06-2014, 01:05 PM
  4. [SOLVED] Is there a combined VLOOKUP & HLOOKUP function?
    By AndyGW in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2012, 10:08 AM
  5. [SOLVED] VLookup and HLookup Combined?
    By Jmarsh4 in forum Excel General
    Replies: 2
    Last Post: 05-15-2012, 01:44 PM
  6. Hlookup and Vlookup Combined (Match?)
    By batman1056 in forum Excel General
    Replies: 3
    Last Post: 06-21-2010, 04:33 PM
  7. VLookup and Hlookup combined using separate workbooks
    By trentonm in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2008, 03:18 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