+ Reply to Thread
Results 1 to 10 of 10

Indirect with sumproduct

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Indirect with sumproduct

    Hi all

    I need some help with a sumproduct and indirect formula please...

    I have three variables which I need the formula to take into account.
    • Branch, in cell C3 of the “master” sheet the user will select the branch. Here I will need the formula to use the indirect feature so it knows what sheet to lookup.
    • Enter Month: Here the user will enter the month
    • Month or YTD – this will be used for the sumproduct part of the formula. If month is selected I would like it to return only the current months data however if YTD is selected I would need the month and all prior month months returned.

    Can anyone help with the formula I need please? The formula is to go in the red cells.

    I have attached an example
    Attached Files Attached Files

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Indirect with sumproduct

    This looks like it could be a "growing" thing. Is that correct?

    If this is going to grow, how are you planning on adding data for future dates?
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Indirect with sumproduct

    It wouldnt be growing - it would only be for a fixed period of time (a year)

  4. #4
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Indirect with sumproduct

    Ok - So I have managed to find a solution to one of the problems. This uses an IF formula to determine weather to use index/match or sumproduct:

    Please Login or Register  to view this content.
    Is this the best way to do it?

    I need some help adding in the indirect formula - how do I reference cell C3 rather than "Branch1"?
    Attached Files Attached Files

  5. #5
    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
    52,926

    Re: Indirect with sumproduct

    Try this...
    actual...
    =INDEX(INDIRECT(C3&"!$R$8:$AE$37"),MATCH($B9,INDIRECT(C3&"!$B$8:$B$37"),0),MATCH(IF($C$5="YTD","YTD",$C$4),INDIRECT(C3&"!$R$8:$AE$8"),0))
    Budget...
    =INDEX(INDIRECT(C3&"!$c$8:$p$37"),MATCH($B9,INDIRECT(C3&"!$B$8:$B$37"),0),MATCH(IF($C$5="YTD","YTD",$C$4),INDIRECT(C3&"!$c$8:$p$8"),0))
    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

  6. #6
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Indirect with sumproduct

    Hi FDibbins - your formula works perfectly however my data is not correct...

    Where you have it looking up the "YTD" column in theory it is fine however my data does not have that column (despite it being shown on the spreadsheet). My data is a direct dump from a P&L however currently it does not have the YTD column - it is a feature I am trying to add.

    Until it is added I need to try and use sumproduct as if the column didnt exist.

    Can I add indirect to this (or a similar formula):

    Please Login or Register  to view this content.
    To avoid confusion I have deleted that column on my model
    Attached Files Attached Files

  7. #7
    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
    52,926

    Re: Indirect with sumproduct

    OK try these 2 then.

    Actual...
    =IF($C$5="YTD",SUM(INDIRECT($C$3&"$R9:$AC9")),INDEX(INDIRECT($C$3&"!$R$8:$AE$37"),MATCH($B9,INDIRECT($C$3&"!$B$8:$B$37"),0),MATCH($C$4,INDIRECT($C$3&"!$R$8:$AE$8"),0)))
    Budget...
    =IF($C$5="YTD",SUM(INDIRECT($C$3&"!$C9:$O9")),INDEX(INDIRECT($C$3&"!$c$8:$o$37"),MATCH($B9,INDIRECT($C$3&"!$B$8:$B$37"),0),MATCH($C$4,INDIRECT($C$3&"!$c$8:$o$8"),0)))

  8. #8
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Indirect with sumproduct

    It's a bit more complex I think, but some of it can be simplified with these formulae

    =SUM(INDEX(INDIRECT($C$3&"!$R$9:$AE$37"),ROW(A1),IF($C$5="YTD",1,MONTH($C$4))):INDEX(INDIRECT($C$3&"!$R$9:$AE$37"),ROW(A1),MONTH($C$4)))

    and

    =SUM(INDEX(INDIRECT($C$3&"!$C$9:$O$37"),ROW(A1),IF($C$5="YTD",1,MONTH($C$4))):INDEX(INDIRECT($C$3&"!$C$9:$O$37"),ROW(A1),MONTH($C$4)))
    Last edited by Bob Phillips; 12-30-2013 at 05:14 PM.

  9. #9
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Indirect with sumproduct

    Thanks FDibbins and Bob - both formulas worked brilliantly!

  10. #10
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Indirect with sumproduct

    Really? Seeing as one of FDibbins had a missing ! (okay you might have spotted and fixed that), and that we get completely different answers for YTD, I can't see how both can work brilliantly. For Apr-13 YTD I get 198 and 196, with FDibbins' formula, I see 581 and 613.

+ 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. Indirect within sumproduct
    By Sumilidon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-25-2012, 03:56 PM
  2. [SOLVED] SUMPRODUCT and INDIRECT
    By Eric Stohr in forum Excel General
    Replies: 7
    Last Post: 05-07-2012, 08:41 AM
  3. Replies: 6
    Last Post: 03-09-2011, 08:01 AM
  4. [SOLVED] Help with Sumproduct with Indirect
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 11:05 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