+ Reply to Thread
Results 1 to 50 of 50

SumProduct using dates

  1. #1
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    SumProduct using dates

    hello

    having some major issues with sumproduct + date formula

    basically i have in summary worksheet D9 = 30-may-2011 ...this drop down shows first monday of every week.

    issue is trying to calculate for month-to-date, for the above categories...im not sure how to tackle this...i tried the formula below, but getting no luck

    c)$ of extra charges ="Y" ....MONTH-to-DATE

    =SUMPRODUCT(--(MONTH('G.S - Report'!$K$8:$K$65536)=MONTH(D10)),--(YEAR('G.S - Report'!$K$8:$K$65536)=YEAR(D10)*('G.S - Report'!$N$8:$N$65536)))

    can someone pls help!

    i have highlighted in red the issues in the summary worksheet.

    ive been on this for the past 3 hrs so if someone can pls help!
    Attached Files Attached Files
    Last edited by jw01; 08-17-2011 at 05:12 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: sumproduct issue (using dates)

    When I apply Autofilter to the GS Report and filter column K for dates between May 30, 2011 and 6 days after (June 5, 2011), and then filter column Q for "Y" only, I count 36.. which is your sumproduct result....

    The #VALUE error is because you have text in a row or two in column N...

    Instead of multiply the summing range, separate it with a comma...

    =SUMPRODUCT(--('G.S - Report'!$K$8:$K$65536>=$D$10),--('G.S - Report'!$K$8:$K$65536<=$D$10+6),--('G.S - Report'!$J$8:$J$65536=K25),('G.S - Report'!$N$8:$N$65536))

    Also, you should avoid such large ranges with Sumproduct.
    Last edited by NBVC; 08-17-2011 at 05:02 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: sumproduct issue (using dates)

    hello

    i might of jumped the ship going crazy with the spread...it appers to be right, thx u so much!


    however the main issue appears to be how i can calculate for the MONTH-TO-DATE using the value in cell D10

    =SUMPRODUCT(--(MONTH('G.S - Report'!$K$8:$K$65536)=MONTH(D10)),--(YEAR('G.S - Report'!$K$8:$K$65536)=YEAR(D10)*('G.S - Report'!$N$8:$N$65536)))

    the issue is, May30 is Monday and June is Tuesday, so when i try to sum for the month, it is searching for May only...is there a way to make it search for May and June for instance where the months clash?

    also, when i try to calculate

    $ of extra charges

    =SUMPRODUCT(--('G.S - Report'!$K$8:$K$65536>=$D$10),--('G.S - Report'!$K$8:$K$65536<=$D$10+6),--('G.S - Report'!$Q$8:$Q$65536=K25)*('G.S - Report'!$N$8:$N$65536))

    it is giving me a #VALUE error.

    i have updated the workbook in the original attachment,...if u can pls advise!

    i really appreciate the help!
    Last edited by jw01; 08-17-2011 at 05:09 PM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    I mentioned above why you are getting #VALUE error. replace the * before the last array with a comma... and in this one, you need another closing bracket after Year(D10)....

    Please Login or Register  to view this content.
    this gives 0, which is correct.. but I do not understand :

    the issue is, May30 is Monday and June is Tuesday, so when i try to sum for the month, it is searching for May only...is there a way to make it search for May and June for instance where the months clash?
    i gotta take off right now, so hopefully you can resolve it yourself or with someone else's continued support... or I will get back to it tonight or tomorrow...

  5. #5
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    I mentioned above why you are getting #VALUE error. replace the * before the last array with a comma... and in this one, you need another closing bracket after Year(D10)....

    Please Login or Register  to view this content.
    this gives 0, which is correct.. but I do not understand :



    i gotta take off right now, so hopefully you can resolve it yourself or with someone else's continued support... or I will get back to it tonight or tomorrow...

    thx u so much...apprecaite the feedback

    i will keep at it...i will post it solved if i can figure it out, otherwise if you can kindly advise at a later time, i wil be truely grateful!

    much appreciated again!

  6. #6
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    hello guys

    any solutions?

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    What about the part where I said I don't understand your problem? Are you going to elaborate on that?

  8. #8
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    hello thxs for your response.

    i have a quesion about sumproduct.

    it appears my formula here

    =SUMPRODUCT(--('G.S - Report'!$L$8:$L$65536>=$D$10),--('G.S - Report'!$L$8:$L$65536<=$D$10+6),('G.S - Report'!$Q$8:$Q$65536=K19))

    gets me an answer of zero

    however, when i do this (add the asterix *)
    =SUMPRODUCT(--('G.S - Report'!$L$8:$L$65536>=$D$10),--('G.S - Report'!$L$8:$L$65536<=$D$10+6)*('G.S - Report'!$Q$8:$Q$65536=K19))

    it gives me 133.00

    NBVC you mentioned to use commas, however it is failing to pick up, now im confused over the sumproduct rule. ur thoughts...thxs

  9. #9
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    What about the part where I said I don't understand your problem? Are you going to elaborate on that?
    sure thing, here is my problem formula

    =SUMPRODUCT(--(MONTH('G.S - Report'!$L$8:$L$65536)=MONTH($D$10)),--(YEAR('G.S - Report'!$L$8:$L$65536)=YEAR($D$10))*('G.S - Report'!$Q$8:$Q$65536=K25))*('G.S - Report'!$N$8:$N$65536)

    basically, im asking it to sum the $ invoice amount of invoices that are month-to-date from June 1-Jun 11

    D10 = June 6, so end of the week is June 11, so i would prefer if "month-to-date" portion sums the invoices from June 1-Jun 11.

    currently it is summing verything for june i.e. June 1-Jun30

    can you pls help! ***pls see new attachement**** here
    Attached Files Attached Files

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SumProduct using dates

    If we assume given .xls SUMIFS etc are precluded then in terms of row 19

    Please Login or Register  to view this content.
    You should be able to determine the remainder from the above.

    I would add that you should not be using such vast precedent ranges with SUMPRODUCT and should consider reducing scope to a reasonable size either via smaller hard-wired range or via non-volatile Dynamic Named Ranges.

  11. #11
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Hello

    I truely apprecaite the help...i was struggling pretty bad with the concept of month and year, so your amazing

    one final question....

    1) # of stores with extra request

    -issue: similar to the formula in row 17 (see below), i need to be able to get this by store # as well (unique store #, not duplicate entries)....so im really confused how i can go about with this.

    formula for row 17 (# of extra service request)
    =SUMPRODUCT(--('G.S - Report'!$L$8:$L$65536>=$D$10),--('G.S - Report'!$L$8:$L$65536<=$D$10+6),--('G.S - Report'!$J$8:$J$65536=$K17))

    i really appreciate the help! **i have attached an updated file, see cell in red**

    thx u again!
    Attached Files Attached Files

  12. #12
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SumProduct using dates

    To get a unique count in this manner a Frequency Array would arguably suit best.

    Before continuing however I would reiterate the point regards Dynamic Source Range.

    First create a Defined Name as follows:

    Please Login or Register  to view this content.
    We can then, if we wish, adjust your existing SUMPRODUCTs to utilise this smaller/dynamic range, e.g:

    Please Login or Register  to view this content.
    From the above you should be able to work out the remainder of the existing SUMPRODUCT calcs
    (i.e. modify the >= date for the columns, modify the 8 (Col J at source) in the final index to reflect the appropriate column for rows 19 & 21 etc...)

    In terms of your unique count...

    Please Login or Register  to view this content.
    Note the Array entry requirement. If the Array has been set correctly the above will appear encased within { }
    (these can not be added manually)

    The formulae in row 29 can be copied to rows 31 & 33, however, yo uwill need to modify your INDEX column 8 (test re: K29) as appropriate (as per the SUMPRODUCT example earlier).
    Remember: When you modify an Array you must remember to confirm the alteration with CTRL + SHIFT + ENTER so as to reset the Array successfully.

    I'm afraid I can't create your file for you as I am at work but the above should suffice.

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    I was going to suggest similar with:

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER not just ENTER and similar for other cells with appropriate changes.

    But I too strongly recommend, as I did initially in this thread also, to not use the whole column in your formula and instead reduce it with a smaller last row number or dynamically as DO showed you.

  14. #14
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    thx u so much...life saver


    i have used what you have given, YTD row 29

    # of stores with extra request for YTD

    =SUM(IF(FREQUENCY(IF(INDEX(_Data,0,10)>=DATE(YEAR($D$10),1,1),IF(INDEX(_Data,0,10)<=$D$10+6,IF(INDEX(_Data,0,8)=$K29,MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0)))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)>0,1))

    thx u so much...i believe i have done it correctly!

    also, if u can quickly confirm, as i use the following as well for rwo 29 Month-to-date

    =SUM(IF(FREQUENCY(IF(INDEX(_Data,0,10)>=$D$10-DAY($D$10)+1,IF(INDEX(_Data,0,10)<=$D$10+6,IF(INDEX(_Data,0,8)=$K29,MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0)))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)>0,1))

    thx u so much for your exceptional help!

  15. #15
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    final question

    i am trying to get the "average # of invoices per store"

    i tried to re-use the formula you provided but getting a value error.

    Average # of invoices per store

    =AVERAGE(IF(FREQUENCY(IF(INDEX(_Data,0,10)>=$D$10,IF(INDEX(_Data,0,10)<=$D$10+6,IF(INDEX(_Data,0,11),MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0)))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)>0,1))

    confirmed by ctl+shift+enter

    pls advise, thx u so much

    i have attached a sample with red highlighted cell....thxs u once again
    Attached Files Attached Files
    Last edited by jw01; 08-18-2011 at 11:19 AM.

  16. #16
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    hello guys

    any suggestions? thx u

  17. #17
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    I don't see too many duplicate stores....

    This formula below gives me a result of 1 invoice per store...

    Please Login or Register  to view this content.
    Array entered.

  18. #18
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Hello NBVC

    I appreciate the help very much. im trying to understand the logic.

    so exactly how can i add another criteria to the following formula for:

    $ extra service charges per store:

    {=AVERAGE(IF(FREQUENCY(IF(INDEX(_Data,0,10)>=$D$10,IF(INDEX(_Data,0,10)<=$D$10+6,IF(INDEX(_Data,0,15)=$K61,MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0)))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)>0,1))}

    however that is only giving me a count, based on... IF(INDEX(_Data,0,15)=$K61
    however, if i wanted to know, IF(INDEX(_Data,0,15)=$K61, and then INDEX(_Data,0,12); column 12 being the invoice amount row.

    if u can kindly help me with that last portion, i can figure how to add multiple scenarios.

    i really apprecaite the help! thx u

  19. #19
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    Does this one work?

    Please Login or Register  to view this content.
    It averages column N based on your date range and column J having "Extra Shred" service.

  20. #20
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    Does this one work?

    Please Login or Register  to view this content.
    It averages column N based on your date range and column J having "Extra Shred" service.
    hello NBVC

    thxs for the prompt response.

    i had to change it, as it was the extra service charge is basically looking into column 15 or (Additional Fee Applied).

    i applied this to row 61, colum F on the summary sheet

    =AVERAGE(IF(FREQUENCY(IF(((INDEX(_Data,0,10)>=$D$10)*(INDEX(_Data,0,10)<=$D$10+6)*(INDEX(_Data,0,15)=K61)),IF(INDEX(_Data,0,11)<>"",MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)>0,INDEX(_Data,0,12)))

    it gave me 68.56

    is my logic placed correctly? thxs for all your help regarding this...ur the best!

  21. #21
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    Seems right. I tried it too and get the same number...

    When I manually filter the data for that date range and y in column Q, all the values in column N average to the same number.... and I don't see any duplicate store # or invoice #, so I am not sure... if you are just looking for average on date criteria and column Q is Y, then even this formula would work:
    Please Login or Register  to view this content.
    confirmed with CSE keys...

  22. #22
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    thx u so much NBVC, world class!

    much much appreciated.

    btw i notcied ur profile said ur from mississauga..same here

  23. #23
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    it says usa in yours

  24. #24
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Hello NBVC

    Yeah sorry, i have to update that...i moved her recently so that is pretty neat!

    i got one more question for you.....

    Avg. per store # of days to service - column O in GS report aka Days to complete

    Weekly - i tried the formula below and its giving me 1.06 if i select June 6 as my target week

    {=AVERAGE(IF(FREQUENCY(IF(INDEX(_Data,0,10)>=$D$10,IF(INDEX(_Data,0,10)<=$D$10+6,IF(INDEX(_Data,0,13)<>"",MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0)))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)>0,FREQUENCY(IF(INDEX(_Data,0,10)>=$D$10,IF(INDEX(_Data,0,10)<=$D$10+6,IF(INDEX(_Data,0,13)<>"",MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0)))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)))|

    when i did a manual check, it gave me 1.29.

    can u kindly help pls and thx u sir!

  25. #25
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    Please post your attachment with the new formulas.

  26. #26
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Hello

    pls see attached. i have highlighted the row in red..thx u so much.
    Attached Files Attached Files

  27. #27
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    Can you tell me how you manually checked? Are there duplicate store numbers?

    When I filtered for dates from June 6 to June 12 and averaged column O manually, I got 1.427.

    I also got that number with this formula:

    Please Login or Register  to view this content.

  28. #28
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    Can you tell me how you manually checked? Are there duplicate store numbers?

    When I filtered for dates from June 6 to June 12 and averaged column O manually, I got 1.427.

    I also got that number with this formula:

    Please Login or Register  to view this content.
    Hello NBVC

    Your are right, I think in my manual filter, i might of doubled counted (duplicates). make sense....*dammit*

    I will use the formula you provided, compared to the formula i had in that cell. I appreciate the prompt response sir! thx u

  29. #29
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Real quick sorry, is there a chance duplicate entries will be counted in the formula you provided?

    but to your point, you just made me realize that store #s can repeat as they might call for additional services, so in that case, the only place where a value will be unique is the invoice #, that should not repeat so *damit*...i might have to change all the reference from column 6 in the index to invoice

    so i have a question, if the invoice # is unique, will i need a frequency formula?
    Last edited by jw01; 08-19-2011 at 10:41 AM.

  30. #30
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    In the last formula yes, duplicate stores will be incorporated, in the previous formula where you got 1.06, I am not 100% sure, because I am not 100% sure what your expectation is.

    Can you tell me what exactly you expect the result to be? And how you come to that?

  31. #31
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    In the last formula yes, duplicate stores will be incorporated, in the previous formula where you got 1.06, I am not 100% sure, because I am not 100% sure what your expectation is.

    Can you tell me what exactly you expect the result to be? And how you come to that?
    Hello NBVC

    so on row 57: avg # of invoices per store..here is the formula

    =AVERAGE(IF(FREQUENCY(IF(INDEX(_Data,0,10)>=$D$10,IF(INDEX(_Data,0,10)<=$D$10+6,IF(INDEX(_Data,0,11)<>"",MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0)))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)>0,FREQUENCY(IF(INDEX(_Data,0,10)>=$D$10,IF(INDEX(_Data,0,10)<=$D$10+6,IF(INDEX(_Data,0,11)<>"",MATCH(INDEX(_Data,0,6),INDEX(_Data,0,6),0)))),ROW(INDEX(_Data,0,6))-ROW(INDEX(_Data,1,6))+1)))

    so basically, it is averaging the # of invoices per store....even though multiple entries for a store exist, it will not count duplicates and average the invoices?...

    so what i need is, or maybe it is doing this:
    -count if multiple stores exist for the week, as i.e. store 001 might do two services, and have two unique invoices.

    so is the formula achieving that goal? im getting confused over this now jeez!

  32. #32
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    im getting confused over this now jeez!
    me too.

    If the invoices are all unique, then the store shouldn't matter, correct?

    If so, then the smaller formula:
    Please Login or Register  to view this content.
    should do the trick... it averages column O based the date criteria only. I get 1.427 with that formula.

    c

  33. #33
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    yeah, it appears the frequency was not really needed as the store # can appear multiple times as they might call for service a few times over a week, month etc.

    so that changes alot of the calculation and makes everything pretty simply.

    so for: # service requests per store, i used the following formula, but getting DIV/0 - line 59 on summary

    {=AVERAGE(IF(((INDEX(_Data,0,10)>=$D$10)*(INDEX(_Data,0,10)<=$D$10+6)),INDEX(_Data,0,8)=$K59))}

    basically, checking the date criteria and asking to average # of items that say "Extra shred" or K59

    when i do a manual filter, there are 225 instance where extra shred appears but the formula is returning a div/0....any idea why?
    thxs so much...this will prob be my final post with this.

    also, for line 61
    $ extra service charges per store
    how can i add to the formula above another criteria...i.e. search by extra and sum the invoice amount / store?

    thx u so much sir!
    Last edited by jw01; 08-19-2011 at 12:07 PM.

  34. #34
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    The conditional parts need to stay together separated by the *, then you need to insert the range you want averaged after the comma, in the "value_if_true" part of the IF() function. And we can get rid of one opening bracket after the IF...

    so:

    Please Login or Register  to view this content.
    here I assumed you wanted to average the 13 column again

  35. #35
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    The conditional parts need to stay together separated by the *, then you need to insert the range you want averaged after the comma, in the "value_if_true" part of the IF() function. And we can get rid of one opening bracket after the IF...

    so:

    Please Login or Register  to view this content.
    here I assumed you wanted to average the 13 column again
    so ur formula is for row 59: # of service request per store (Avg).
    ...column 13 is days to complete....so
    so there were 225 extra shred request, so per store that is....1.41..base on the formula for the week of 6-june-2011?

    did i follow that correctly?

    should it be....
    the formula divided by count of invoices for that week?
    so i.e. counta(index(_data,0,6) ....6 being the store?
    ur thoughts?
    thxs for the help

    also, finally

    i used this formula for .... # of extra service charge invoices per store (row 63)

    =AVERAGE(IF((INDEX(_Data,0,10)>=$D$10)*(INDEX(_Data,0,10)<=$D$10+6)*(INDEX(_Data,0,15)=$K63),INDEX(_Data,0,6)))
    and get 606....that seems rather high?
    Last edited by jw01; 08-19-2011 at 01:10 PM.

  36. #36
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    There seems to be 182 extra shred requests, not 225... and the average of the days to complete is 1.41

    The formula is already averaging (it is sum/count ... but you still need to define the criteria).

  37. #37
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    There seems to be 182 extra shred requests, not 225... and the average of the days to complete is 1.41

    The formula is already averaging (it is sum/count ... but you still need to define the criteria).
    great awesome, thx u sir

    if u can kindly so confirm this last entry

    # of extra service charge invoices per store - row 63

    {=AVERAGE(IF((INDEX(_Data,0,10)>=$D$10)*(INDEX(_Data,0,10)<=$D$10+6)*(INDEX(_Data,0,15)=$K63),INDEX(_Data,0,6)))}

    im getting a total of 775 for jun 6th week....is that too high..or is that ok? thx u

  38. #38
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    That formula says you are averaging column H which is your Store numbers... I don't think that is what you want.

    Are you counting or averaging? And if averaging, which column?

  39. #39
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    That formula says you are averaging column H which is your Store numbers... I don't think that is what you want.

    Are you counting or averaging? And if averaging, which column?
    hello

    on row 63 : # of extra service charge invoices per store

    im using column 15 (applied additional fees) and then using store # column (6)

    so its giving me 775

    so basically, asking for it to check for "Y" in extra charges applied and then count # of stores

    is my logic correct? thx yu

  40. #40
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    To just count you need to go back to the SUMPRODUCT:

    =SUMPRODUCT(--(INDEX(_Data,0,10)>=$D$10),--(INDEX(_Data,0,10)<=$D$10+6),--(INDEX(_Data,0,15)=$K63))

  41. #41
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    hello nbvc

    im back for one final request. having some issues with the following two "AVERAGE" formulas (i have highlighted in red)

    row 59: AVERAGE # of invoices per store

    row 71: AVERAGE # of days to service

    they are both using the same formula for week etc

    {=AVERAGE(IF(((INDEX(_Data,0,10)>=$D$10)*(INDEX(_Data,0,10)<=$D$10+6)),INDEX(_Data,0,13)))}

    can u pls help!



    finally, row 65 and 69 are using sumproduct when it should be average...can i simply wrap that formula around with average?
    i.e.
    row 59 - average # of extra service charge invoices per store

    =average(SUMPRODUCT(--(INDEX(_Data,0,10)>=$D$10),--(INDEX(_Data,0,10)<=$D$10+6),--(INDEX(_Data,0,15)=$K65)))


    *u can simply unprotect workbook by running macro "unprotect"*

    can u kindly help one final time, thx u sir! grately appreciated.
    Attached Files Attached Files

  42. #42
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    So if you averaging per store, does column O values not apply?

    What are the actual (accurate!) expected results?

  43. #43
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Hello NBVC

    appreciate the response.

    row 71 average # of days to service - appears to be correct

    however

    row 59: AVERAGE # of invoices per store - seems to using the dates in column O

    is that a fair reflection? shouldnt it be using column M "invoice number to get a count"?

    your thoughts?

    finally, row 65 and 69 are using sumproduct when it should be average...can i simply wrap that formula around with average?
    i.e.
    row 59 - average # of extra service charge invoices per store

    =average(SUMPRODUCT(--(INDEX(_Data,0,10)>=$D$10),--(INDEX(_Data,0,10)<=$D$10+6),--(INDEX(_Data,0,15)=$K65)))

  44. #44
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    I meant column O in your Summary sheet. You have the Average(Frequency) formulas there. Are those results correct (i.e. 1.08)?

  45. #45
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    Quote Originally Posted by NBVC View Post
    I meant column O in your Summary sheet. You have the Average(Frequency) formulas there. Are those results correct (i.e. 1.08)?
    yes they are correct. can i simply use that for row 59?

    the only reason why i didnt go forward with the frequency on those is bc i was told
    1) a store can appear a few times, however will alwasy create a unique invoice #.

    so can i simply use that formula for in column O row 59? and the other row 65 and 69 ??? kindly let me know, thx u
    Last edited by jw01; 08-24-2011 at 11:46 AM.

  46. #46
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    If you are trying to find average number of invoice per store, then you want to count the number of invoices in each store (ie. store may appear multiple times), then average that number over the number of stores?

    I think that is what the formulas in column O of the summary are doing.

  47. #47
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    ok thxs...i will go with that logic for those ones......thxs for your help with this matter sir!

  48. #48
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    I hope this is the final question as this file has given me grey hair!

    in the most recent attached file on row 69:

    AVERAGE # of credit invoices per store

    =AVERAGE(IF((INDEX(_Data,0,10)>=$D$10)*(INDEX(_Data,0,10)<=$D$10+6),--(INDEX(_Data,0,21)=$K69)))

    does that appear correct to you...my usage of the formula? i selected 27-june and its giving me 0.8.

    if u can kindly and pls advise, thx u sir.

  49. #49
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SumProduct using dates

    I used:

    Please Login or Register  to view this content.
    CSE confirmed and got 1.. which seems correct after filter the source data.

  50. #50
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,224

    Re: SumProduct using dates

    hello

    thxs for all your help.

    it's giving me div/0 error which is cool for 30-may-11

    but since the formula is so huge, i cant implement the if(iserror(

    and im using 03...any way to work round that? thxs havea great evening

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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