+ Reply to Thread
Results 1 to 15 of 15

Dynamic fomula for Month, Qtr and YTD

  1. #1
    Registered User
    Join Date
    02-11-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007 or Excel 2010.
    Posts
    65

    Dynamic fomula for Month, Qtr and YTD

    Hi Team,

    I want to find spend, save and loss numbers for the names in the drop down by month, quarter, and YTD. It is in a particular format and I am not sure what kind of formula to use in this case.

    I have attached the test file for better understanding

    Please note Month and Quarter also have drop down and by selecting them the formula should provide the Spend, save and los numbers.

    Appreciate your help!

    Thanks!

    Guru
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Dynamic fomula for Month, Qtr and YTD

    This is what I have so far.

    For the months array enter this formula in B2 an fill across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    For quarters array entered in B3 and fill across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    The YTD I haven't done, yet.
    Attached Files Attached Files
    Dave

  3. #3
    Registered User
    Join Date
    02-11-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007 or Excel 2010.
    Posts
    65

    Re: Dynamic fomula for Month, Qtr and YTD

    Hi Dave,

    Thank you so much it works beautifully. I hope you could help with YTD too whenever you find time.

    Thanks a ton again, really appreciate your help.

    4Gurus

  4. #4
    Registered User
    Join Date
    02-11-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007 or Excel 2010.
    Posts
    65

    Re: Dynamic fomula for Month, Qtr and YTD

    Hi Dave,

    Sorry, I forgot to ask one more thing what kind of edit should I make in the Qtr formula so that I get the sum of Qtrs spend, loss, and save for all the people instead of individual.

    Thank you!

    4Gurus

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Dynamic fomula for Month, Qtr and YTD

    Hi 4gurus,

    Been working on some alternative formulas.

    The YTD thing is throwing me so the formula in row 4 is a work in progress.

    I've taken the liberty of inserting two helper rows above the source data.

    The reason being merged cells cause havoc for formulas. The helper rows are a way out.

    In B6 filled down and across to S7 of the attached this helper row formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Are we OK so far?
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Dynamic fomula for Month, Qtr and YTD

    Dave,

    Just a thought:

    I would make your date helper (row 7) actual dates (01/01/2016 for first three) ..etc

    then use for YTD

    =SUMPRODUCT(($B$11:$S$14)*($B$10:$S$10=B$1)*(MONTH($B$7:$S$7)<=MONTH(TODAY())*($A$11:$A$14=$A$1)))

    I would go further and put the dates in row 9 in the above, formatted as "mmm"

    This is because I do not like (nor advocate) the use of simple Text dates (my bee in the bonnet!!)

    Using dates, then the quarter calculations could be on start/end month for a quarter,

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Dynamic fomula for Month, Qtr and YTD

    @ John,

    I like it.

    In fact I borrowed your idea and extended it a bit to the Data Validation lists and the original month row (9).

    I am kind of stuck right now on how to explain simply what I've done though. Quite a few changes. I am afraid I will unnecessarily risk introducing confusion.

    I would suggest a slight change to your formula. OP wants YTD to be all
    what kind of edit should I make in the Qtr formula so that I get the sum of Qtrs spend, loss, and save for all the people instead of individual.
    Removing the name ($A$11:$A$14=$A$1) criteria does the trick.

    =SUMPRODUCT(($B$11:$S$14)*($B$10:$S$10=B$1)*(MONTH($B$7:$S$7)<=MONTH(TODAY())))


    Thanks for the backup and assist. It's appreciated. I love team-builds.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Dynamic fomula for Month, Qtr and YTD

    @Dave,
    Glad to have helped and thank you for the feedback.

    I too like "team builds" not least because it fills in the many holes in my knowledge.

  9. #9
    Registered User
    Join Date
    02-11-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007 or Excel 2010.
    Posts
    65

    Re: Dynamic fomula for Month, Qtr and YTD

    Hi Dave and John,

    Thank you both for your valuable help. Dave I think the helper columns has simplified the formula which is great; however when I try sumproduct formula to get total spend achieved by team for the Qtr1 or Qtr2 using drop down I get an error like #value! not sure how link the formula to the drop down.

    Thanks!

    4Gurus

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Dynamic fomula for Month, Qtr and YTD

    In W1 to W4 add "Qtr" start dates

    01/01/2016
    01/04/2016
    01/07/2016
    01/10/2016

    For Qtr team total:

    Spend

    =SUMPRODUCT(($B$11:$S$14)*($B$10:$S$10=B$1)*($B$9:$S$9>=VLOOKUP($A$3,$V$1:$W$4,2,0))*($B$9:$S$9<=EOMONTH(VLOOKUP($A$3,$V$1:$W$4,2,0),2)))

    Copy across for "Save" & "Loss"

    See table in A17 etc

    OR

    this removes need for W1:W4 data



    =SUMPRODUCT(($B$11:$S$14)*($B$10:$S$10=B$1)*($B$9:$S$9>=DATE(2016,(RIGHT($A3)+0-1)*3+1,1))*($B$9:$S$9<=EOMONTH(DATE(2016,(RIGHT($A3)+0-1)*3+1,1),2)))
    Attached Files Attached Files
    Last edited by JohnTopley; 07-22-2016 at 08:27 AM.

  11. #11
    Registered User
    Join Date
    02-11-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007 or Excel 2010.
    Posts
    65

    Re: Dynamic fomula for Month, Qtr and YTD

    Hi John,

    Thank you so much for your assistance and your formula works like a charm now the only thing I am left with is to find monthly spend, loss, and save for individual and the team; however, I have tried the formula SUMPRODUCT(($B$11:$S$14)*($B$10:$S$10=$B1)*($A$11:$A$14=$A$1)*($B$7:$S$7=A2)) but I get Zero not sure what I could be missing.

    Please let me know what changes I need to make to get the numbers for individual and team for the month

    Thanks!

    4Gurus

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Dynamic fomula for Month, Qtr and YTD

    You have these formulae: in B2 to D2 and B5 to D5

    formula from B2

    =SUMPRODUCT(($B$11:$S$14)*($B$10:$S$10=B$1)*($B$9:$S$9>=DATE(2016,MONTH($A$2&1),1))*($B$9:$S$9<=EOMONTH(DATE(2016,MONTH($A$2&1),1),0)*($A$11:$A$14=$A$1)))

    from B5

    =SUMPRODUCT(($B$11:$S$14)*($B$10:$S$10=B$1)*($B$9:$S$9>=DATE(2016,MONTH($A$2&1),1))*($B$9:$S$9<=EOMONTH(DATE(2016,MONTH($A$2&1),1),0)))
    Last edited by JohnTopley; 07-23-2016 at 03:10 PM.

  13. #13
    Registered User
    Join Date
    02-11-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007 or Excel 2010.
    Posts
    65

    Re: Dynamic fomula for Month, Qtr and YTD

    Hi John,

    Thank you so much for your help on the formulae. I never knew how beautifully sumproduct works (unless one knows how to effectively use it) and it is an alternate for match and index formula.

    Once again many thanks to Dave and you for being my savior/saviour

    Thanks!
    4Gurus

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Dynamic fomula for Month, Qtr and YTD

    You are very welcome. Thank you for the feedback.

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Dynamic fomula for Month, Qtr and YTD

    You are welcome. Thank you for the feedback.

+ 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. Dynamic Sum for Quarter with month as MMM text
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-24-2016, 09:16 AM
  2. Automatic or dynamic rolling month
    By Akatecho in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2014, 06:27 AM
  3. 3 month rolling - dynamic
    By Armitage2k in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-05-2014, 09:26 AM
  4. [SOLVED] Dynamic Top 5 Customer per month
    By dluhut in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-03-2014, 06:37 AM
  5. Perserving dynamic value for month and year
    By D-smoke in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-10-2013, 08:06 AM
  6. Dynamic Month Names
    By sambo1982 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-10-2011, 05:10 AM
  7. Dynamic nth Day of Weekday-Next Month
    By nms2130 in forum Excel General
    Replies: 2
    Last Post: 06-29-2010, 09:56 AM

Tags for this Thread

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