+ Reply to Thread
Results 1 to 10 of 10

Index/match formula to return data to summary sheet

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

    Index/match formula to return data to summary sheet

    Hi,

    I have a spreadsheet which I am creating and I have a new requirement...

    In the attached sheet on the “Cost Summary” sheet I require a formula in the cell range highlighted in blue – B57:D84

    Here I need the formula to pull data from the relevant sheet based on the user selection C53 (this will tell it which branch data sheet to look in) and C54 (this will tell it what to match). The index will be the branch number and always column B:E. I need the formula to find the first instance of the match in cell C54 and report the GL Code (Column B), Month Actual (Column D) and Month Budget (column E). Then I need it to find the next instance, report it, and find the next and so on and so on. I would only need it to return values greater than 1.

    Its hard for me to explain so in green I have included an example with explanations of where the data needs to be pulled from.

    Can anyone help please?
    Attached Files Attached Files

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

    Re: Index/match formula to return data to summary sheet

    I tried this in B57 but it isnt correct - returns an error.

    =INDEX(INDIRECT("'"&$C$53&" Data'!$B:$F"),MATCH($C$54,INDIRECT("'"&$C$53&" Data'!$D$5:$F$500"),0),1)

    I was thinking that I would need the index row to add 1 each time it finds a match - unsure how to do this.

    Any ideas?

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Index/match formula to return data to summary sheet

    How about using PivotTables?

    I inserted one so that you can see what I mean. Pivottables are good for things like that.
    Attached Files Attached Files

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

    Re: Index/match formula to return data to summary sheet

    I wouldnt be able to use a pivot table as the data could be held on any one of 15 sheets from "Branch1 Data" to "Branch15 Data" - which sheet will be dependandt on the user's selection

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

    Re: Index/match formula to return data to summary sheet

    Possibly with an array formula in B57:

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER not just ENTER.

    Notice that with this formula you need to define ranges, no whole columns....

    then, if the G/L are unique in the Branch sheets, you can use SUMIF

    in C57:

    =IF(B57="","",SUMIF(INDIRECT("'"&$C$53&" Data'!$B2:$B500"),B57,INDIRECT("'"&$C$53&" Data'!$D2:$D500")))

    in D57:

    =IF(B57="","",SUMIF(INDIRECT("'"&$C$53&" Data'!$B2:$B500"),B57,INDIRECT("'"&$C$53&" Data'!$E2:$E500")))

    copied down,

    otherwise use the same array formula above, subbing the last number 1 with 3 and 4 to define column numbers...
    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.

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

    Re: Index/match formula to return data to summary sheet

    I am always amazed by the level of help on this forum - espically you NBVC

    That worked brilliantly.

    I may have one last match formula I need help on (famous last words) but I want to try and work it out myself first before I post - Its related to the same spreadsheet - pulling the M2 information (row 7 on the summary sheets) form a data table

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

    Re: Index/match formula to return data to summary sheet

    no problem... if you get stuck just ask... someone will surely help...

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

    Re: Index/match formula to return data to summary sheet

    I must be doing something wrong as I can not get the row to match...

    Here is my formula – what am I doing wrong?
    Please Login or Register  to view this content.
    I have uploaded the file – I am trying to match the Branch and Profit centre on the sheet "summary" with Column A of the "M2 Data" sheet and matching the month which is in Cell B1 on the "summary" sheet with Row 4 on the “M2 Data” sheet

    If there is a better formula than I have used above please say.

    The data in the M2 sheet doesn’t have to be laid out this way if there is an easier way?

    I have uploaded the sheet. Formula required in the yellow cells.
    Attached Files Attached Files

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

    Re: Index/match formula to return data to summary sheet

    Two things.

    The word Total in C12 of M2 Data has a trailing space.. remove it and check the others while you are at it.

    Also, the second MATCH() function should start at D since your INDEXing started at D.. or else you will need to add number of columns to offset from D....

    so formula is:

    =INDEX('M2 Data'!D:O,MATCH(C3&D3,'M2 Data'!$A:$A,0),MATCH($B$1,'M2 Data'!$D$4:$O$4,0))

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

    Re: Index/match formula to return data to summary sheet

    Thanks NBVC - this is now solved!

+ 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