+ Reply to Thread
Results 1 to 5 of 5

Combining HLOOKUP and SUMIF into one formula

  1. #1
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Question Combining HLOOKUP and SUMIF into one formula

    Hello,

    I have a rather complex sheet which is collating tickets sold by cinema for multiple cinema chains.

    It does this by having 3 worksheets;
    sheet 1) the dashboard where the sales are collated - it is here that I want to solve the problem. Currently, the formula go the the second worksheet and SUMIF the data there
    sheet 2) the PBYP sheet collates the sales using HLOOKUP from the 3rd sheet
    sheet 3) titled MAN, this is where the data is stored, in columns with week ending dates

    I want a formula in the dashboard that will let me;
    a) combine the function of finding the dated column in sheet 3 and then summing the data in that column based on the criteria in Row A of sheet 3
    b) this would in effect render sheet 2 useless, and given I have to have this work over 18 different datasets, that would help with filesize
    c) I need to give this to a client for them to use, and as such - want to try and avoid macro or pivot if at all possible

    I tried some use of SUMPRODUCT, and INDEX/MATCH - using the searches on the forum, but I am unfamiliar with them and when I tried to apply them (see the blue cells on sheet 1 - DASHBOARD) they failed to work.

    Can anyone help by altering and reposting the formula in the attached - specifically the sheet named DASHBOARD and the blue cells I highlighted. From there, I should be able to configure the sheet further if I know what the formula should be.

    Thank you in advance for the assistance,

    Ian
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Combining HLOOKUP and SUMIF into one formula

    well to sum all on sheet MAN on date in j9 based on sheet MAN = * value in I9 *
    =SUMIF(MAN!$B$2:$B$382,"*" & $I9 &"*",INDEX(MAN!$B$2:$M$382,0,MATCH(J$8,MAN!$B$1:$M$1,0)))
    that would give
    29-Jun-14 22-Jun-14 15-Jun-14
    4,507 3,343 2,387
    for cineworld
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Re: Combining HLOOKUP and SUMIF into one formula

    Thank you Martin,
    I posted it in and it works a treat - BUT - the value in the dated columns for Cineworld should be the difference between the sum of each week.

    Am I right in thinking then that I need to have a sum, like this;

    =(SUMIF(MAN!$B$2:$B$382,"*" & $I9 &"*",INDEX(MAN!$B$2:$M$382,0,MATCH(K$8,MAN!$B$1:$M$1,0))))-(SUMIF(MAN!$B$2:$B$382,"*" & $I9 &"*",INDEX(MAN!$B$2:$M$382,0,MATCH(L$8,MAN!$B$1:$M$1,0))))

    Have posted in the attached, but I get stuck (all in the DASHBOARD sheet) after the sum in J9.
    K9 seems to not return the correct value and as I don't reference the total for the week prior to w/e 15 June, I'm uncertain as to how to populate cell L9.

    Have posted again the updated sheet with row 9 of DASHBOARD where I've implemented your brilliant help.

    Thanks very much,

    Ian

    2014_15_REPORT TEST - Copy.xlsm

  4. #4
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Re: Combining HLOOKUP and SUMIF into one formula

    Just a friendly bump to see if anyone could help me over the line with my second query please.

  5. #5
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Re: Combining HLOOKUP and SUMIF into one formula

    Hello again all,

    Resurrecting this old one as I want to now take the formula one stage further.

    On the attached sheet, the DASHBOARD has sumif/index/match combinations in rows 10-19, both looking at the data in sheets MAN1 and MAN2.

    Problem I have is when I replicate the dashboard grids and add data sheets, it's fiddly having to find/replace the worksheet names within the formulas (currently MAN1 & MAN2).

    What I would like to do is have the DASHBOARD grid on the left look at the event code in cell G7, and find the worksheet called that, and the formula still work.

    I understand an INDIRECT formula may work but I'm not sure how to integrate it into what is already a long formula.

    I would love a steer on this one please?

    Ian

    CINEMA_2015-16_workings.xlsm

+ 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. Combining Vlookup with Hlookup
    By Mugendi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-05-2014, 08:32 AM
  2. Formula Combining the SUMIF and LEFT functions to calculate totals
    By The_Snook in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-29-2013, 01:28 PM
  3. [SOLVED] SUMIF formula with dynamic column? HLOOKUP?
    By jrvstl in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-01-2012, 12:04 AM
  4. Combining index and hlookup?
    By thisiscrazy in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-21-2009, 05:33 PM
  5. combining column number and hlookup
    By lst2007 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-29-2007, 11:44 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