+ Reply to Thread
Results 1 to 29 of 29

Index / Match / Sum formula to show weekly figures

  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Index / Match / Sum formula to show weekly figures

    I hope you guys can help me again. I originally posted and got my answer a while ago : http://www.excelforum.com/excel-form...ml#post3457010

    but now as a new year starts I want to extend the data, rather than have a sheet for each year. original question was :

    attached is a returns sheets that a qty is logged against part number every week.
    Some of the data I can use pivots on ( no problem ), but I have an issue on the returns tab where I think index/match / sum or something else will be better.
    At the moment because of the layout of data I have to drag each week number into the pivot value, do a greater than zero filter then summarize as a sum (yuk) I just cant get my head around index/match /sum, but can someone help?
    It would be great just to be able to enter a week number, and all the warehouse, part numbers and qty came through.
    There is a short explanation on the returns tab of what im looking for. Thanks in advance.

    so in essence I want week numbers across the top, but be able to enter a year on the returns tab that looks at the week number. I don't know enough about the formula to change.

    Thanks
    Attached Files Attached Files
    Last edited by interested; 01-15-2014 at 09:15 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Index / Match / Sum formula to show weekly figures

    There doesn't seem to be anything on your data sheet to define the year number of each week, I would guess you would want to build the named range "data" up using an if statement to select the correct row,

    For example:
    =IF(Returns!G1="2013",Data!$A$BG,Data!$BH:$BQ)

    However, this would mean you need to put the item/return/description/price/whse/total/average columns at the start of each year. Otherwise, you would have to adjust the column that is selected for the year, for example, if you would have returned week2 in 2013, you would then add something like:
    +if(Returns!G1="2014",52,0)
    to move it forward 52 columns to the next year.

  3. #3
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Would it work if I merged a row above weeks 1-52 called 2013, then 2014 etc. im a bit of a noob so don't really know how to put it in practice. thanks for the quick reply

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Index / Match / Sum formula to show weekly figures

    I'm not to clued up on merged cells, I would just rename the cells "2013 wk1", "2013 wk2" and so on.

  5. #5
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Thanks, but I cant seem to get things to work. ive uploaded a sheet again, changed text to 2013 wk1 etc for 10 weeks. ive merged the cells above and added the year to show what I was thinking. Can you enter the formulas and re upload for me. If adding 2013 / 2014 prefix is the only way, then I will add them to the finish workbook. thanks again
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Index / Match / Sum formula to show weekly figures

    hmm, maybe with the merged cells with the year above them (and reverting back to WK1 not 2013WK1) you could use:
    =LARGE(IF(Data!A2:BQ2="WK"&G2,COLUMN(A1:BQ1),0),IF(G1=2013,2,1))
    to return the column number on the data sheet for the year/week in G1:G2

  7. #7
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Thanks, but where am I putting this formula exactly. ive put the dates back to wk1 etc and tried the formula in any cell and it returns a value of 8 when year set to 2013 and week 1. ( a presume its an array formula as nothing else worked) when I change to week 2 I get 9. is this what was expected?

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Index / Match / Sum formula to show weekly figures

    I don't really follow all the formulas in your sheet but I assumed you would use it as part of B3 to get the "column" for the week.

    So instead of:
    ="Data!"&ADDRESS(2,MATCH("WK"&G2,Data!2:2,0))&":"&ADDRESS(300,MATCH("WK"&G2,Data!2:2,0))
    you could use
    ="Data!"&ADDRESS(2,LARGE(IF(Data!A2:BQ2="WK"&G2,COLUMN(A1:BQ1),0),IF(G1=2013,2,1)))&":"&ADDRESS(300,LARGE(IF(Data!A2:BQ2="WK"&G2,COLUMN(A1:BQ1),0),IF(G1=2013,2,1)))

    Like you say, as an array formula, which would return the address of the column for the year you want, to use as part of all your indirect functions.

  9. #9
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    mmm, cant seem to get it to work. B3 just shows now as a "value" . you did the indirect formula for me in the original post I did. I don't know anything about changing it. thanks so far

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Index / Match / Sum formula to show weekly figures

    Did you confirm it with ctrl+shift+enter?

  11. #11
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    yes I did. I got an error in the indirect formula as the data had changed from B2 - B3. I changed it and it just shows as "value! ill attach to show.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Ive just gone in the formula and spotted A1:BQ1 from this part of formula (WK"&G2,COLUMN(A1:BQ1), shows in the returns tab and not picking up from the data tab?

  13. #13
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Index / Match / Sum formula to show weekly figures

    oh right I see, it will only work for weeks 1 - 10 as it relies on there being a column for every WK number in each year.

  14. #14
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Would it help if above week number it had year? To cross ref. so for example e1 was 2013&e2 was week number.

  15. #15
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Index / Match / Sum formula to show weekly figures

    Check the attachment file for solution
    Attached Files Attached Files


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  16. #16
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Thanks for the reply, but I think there is an error some where? I put qty 2 in week 10 of

    EE23379RG
    EE23381RG
    EE23383RG

    and the sheet returns

    EE23380RG 7
    EE23382RG 3
    EE23384RG 3

    every other one

    I would also like to use this each coming year until the end of the sheet if possible.( it stops at 10 at the moment)

    if it was a table format would it automatically pick up the data?


    thanks very much for your input so far.

  17. #17
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Index / Match / Sum formula to show weekly figures

    Please alway show it in excel with cell references and expected result

  18. #18
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Ok. on the attached file, the data tab for 2014 week 10 has 3 entries highlighted in yellow. the returning result on the returns tab is different as per comments.

  19. #19
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Index / Match / Sum formula to show weekly figures

    Replace the D5 Cell of Returns Sheet formula with the below one

    =IFERROR(VLOOKUP([@[Part number]],Data!A:BQ,$C$2,FALSE),"")

  20. #20
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Thanks for the reply, but something's not working.( or more likely me !!)
    I replaced D5 with =IFERROR(VLOOKUP(returns[[#This Row],[Part number]],Data!A:BQ,$C$2,FALSE),"") , but this returns a zero value. If I enter any other week numbers, they return the wrong values. ie I changed to 2013 & week 1 and added a qty of 10 to each of these
    EE23379
    EE23380
    EE23381

    result = no data

  21. #21
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Index / Match / Sum formula to show weekly figures

    Oopss... It's my mistake I Missed the Row() Part in the below formula. Now added it

    In B5 Cell - Array Formula - Requires CTRL+SHIFT+ENTER

    =IFERROR(INDEX(Data!$A$3:$A$56,SMALL(IF(INDEX(Data!$A$3:$BQ$56,,$C$2)<>"",ROW(INDEX(Data!$A$3:$BQ$56,,$C$2))-MIN(ROW(INDEX(Data!$A$3:$BQ$56,,$C$2)))+1),ROW(A1))),"")

    Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

  22. #22
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Ah, now where where we talking good work. now I need to be able to expand the weeks up to week 52 for 2014, then do the same for 2015 etc. can this be done.

  23. #23
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Index / Match / Sum formula to show weekly figures

    Revised Formula For C2 Cell - Array Formula - Requires CTRL+SHIFT+ENTER

    =MIN(IF((Data!H1:XFC1=B1)*(Data!H2:XFC2="WK"&B2),COLUMN(Data!H2:XFC2)))

    Revised Formula For B5 Cell - Array Formula - Requires CTRL+SHIFT+ENTER

    =IFERROR(INDEX(Data!$A$3:$A$56,SMALL(IF(INDEX(Data!$A$3:$XFC$56,,$C$2)<>"",ROW(INDEX(Data!$A$3:$XFC$56,,$C$2))-MIN(INDEX(Data!$A$3:$XFC$56,,$C$2))+1),ROW(A1))),"")

    Revised Formula For D5 Cell

    =IFERROR(VLOOKUP([@[Part number]],Data!A:XFC,$C$2,FALSE),"")

    Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

    I just increased the column ref BQ to upto XFC

    In the B5 Cell formula the rows are mentioned upto 56 so increased it if your data sized increases.

  24. #24
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Ok, changed the formulas, but still a small issue. ive added upto week 52 , 2014 and added 3 sets of data to the top 3 items. The value returned should be

    EE23379 x 2
    EE23380 x 2
    EE23381 x 2

    it returns :

    EE23380
    EE23381
    EE23382

    1 out. its the same in every field

    is that the +1 in the formula??

  25. #25
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Any ideas? Sixthsense

  26. #26
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Index / Match / Sum formula to show weekly figures

    Please attach a sample workbook to give exact solution otherwise it is going to be a guess work

  27. #27
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    Thanks for coming back to me. work book attached explaining issue

  28. #28
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Index / Match / Sum formula to show weekly figures

    Oops.... Again I am missing the ROW() function which is discussed in Post # 21

    Apology for doing the same mistake again and again....

    Here is the corrected formula

    In B5 cell - Array Formula - Requires CTRL+SHIFT+ENTER

    =IFERROR(INDEX(Data!$A$3:$A$56,SMALL(IF(INDEX(Data!$A$3:$XFC$56,,$C$2)<>"",ROW(INDEX(Data!$A$3:$XFC$56,,$C$2))-MIN(ROW(INDEX(Data!$A$3:$XFC$56,,$C$2)))),ROW(A1))+1),"")

    Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

  29. #29
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Index / Match / Sum formula to show weekly figures

    That's it !! thanks for your input in solving my problem. I extended all the $56 rows to 500 for the real sheet.

+ 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] Index / Match / sum formula to show weekly figures
    By interested in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-30-2013, 05:44 AM
  2. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  3. [SOLVED] Formula to show alternate weekly team.
    By Ortz in forum Excel General
    Replies: 3
    Last Post: 07-17-2012, 07:02 PM
  4. Index Match: Show blank instead of #NA for no match
    By cedarhill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2011, 03:21 PM
  5. Index and match function for Last Month figures
    By Harrold in forum Excel General
    Replies: 7
    Last Post: 03-09-2011, 04:24 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