+ Reply to Thread
Results 1 to 5 of 5

How to look up data by a heading and then a subheading that are the same.

  1. #1
    Registered User
    Join Date
    07-09-2010
    Location
    Denver
    MS-Off Ver
    Excel 2003
    Posts
    4

    How to look up data by a heading and then a subheading that are the same.

    I need to look up specific data based on a format like:

    Project Number 1 (in column A)
    Transportation (in column B) $500 (in column C)
    Structural $50
    Water $250

    Project Number 2 (in column A)
    Transportation (in Column B) $75 (in column C)
    Structural $100
    Water $250....etc.

    So I first need to lookup the project number and then lookup transportation or Structural or Water and return the dollar value. This needs to be done using a lookup or something because each month a new report is generated and the cell location of Project Number 1..2..etc. will change from month to month so I don't have a fixed cell location for any of the data.

    Any ideas how to look this data up?

    Thank you.

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

    Re: How to look up data by a heading and then a subheading that are the same.

    I would suggest posting a sample file that illustrates the layout...

    If (as inferred) the subheadings are consistent for all "tables" (ie all have Transportation, Structural, Water) then in reality it would simply be a case of:

    =INDEX(Sheet2!C:C,MATCH(A1,Sheet2!A:A,0)+MATCH(B1,{"Transportation","Structural","Water"},0)-1)

    where A1:B1 contains heading & sub heading of interest (respectively)

    In reality it may not be this trivial, in which case to reiterate, post a sample file which accurately reflects setup and requirements.

  3. #3
    Registered User
    Join Date
    07-09-2010
    Location
    Denver
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to look up data by a heading and then a subheading that are the same.

    OK here are the files. I want to find the dollar amount projected for transportation or Land Development or...etc. for the month for a specific project from the "File I want to get data from.xls" and place that data in the "File I want to place the data in.xls" The difficulty is the "File I want to get data from.xls" changes each month as new projects are added to the list, so I do not have a fixed cell location. Right now I am hand entering the information from the one file to the other file. I would love to automate this so it will just look up the information each month as I replace the "File I want to get data from.xls" I hope these files make it more clear.

    Thanks so much for the help!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-09-2010
    Location
    Denver
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to look up data by a heading and then a subheading that are the same.

    OK, I'm getting closer to the answer I need. Here is what I have so far.

    =INDEX('[CMRP10-07.xls]Clutter'!$E:$E,MATCH("*: 1000-5280.00*",'[CMRP10-07.xls]Clutter'!$B:$B,0)+8,0)

    The issue I'm having is still in the subheading area. I have found that the subheadings are not consistant. I'll have a project that has 4 subheadings and others with just two. It depends upon if accounting placed a budget in the subheading or not. If they did, the subheading will show up, if they did not the subheading will not show up in the spreadsheet. So you will have:

    1000-5000.09
    Transportation
    Structural
    Water

    1000-5020.00
    Land Development
    Transportation
    Water

    1000-5025.00
    Land Development
    Water

    etc.

    So the order of the subheadings is consistant, but on each project you will only have the subheadings appear if accounting has placed a budget in that item. That is why in my equation I have a +8, (in red) because I do not know how to make it look up the location of the subheading since I do not know how many subheadings there will be for any given project number. So it is almost automatic, I just have to make sure from month to month that accounting did not add a subheading to a project since the +8 is hard code with no intelegence! So if I did as suggested:

    =INDEX(Sheet2!C:C,MATCH(A1,Sheet2!A:A,0)+MATCH(B1,{"Transportation","Structural","Water"},0)-1)

    I will get the wrong number to add, because the array {"Transportation","Structural","Water"} is not consistant between all the projects. The order is consistant, but on any given project one might have just Transportation, or Transportation and Water...etc.

    Any ideas on how to solve this?

    Thanks again for the help!
    Attached Files Attached Files
    Last edited by PastaJ; 07-21-2010 at 10:26 AM. Reason: forgot to add file

  5. #5
    Registered User
    Join Date
    07-09-2010
    Location
    Denver
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to look up data by a heading and then a subheading that are the same. SOLVED

    I Solved it!!! Here is what I came up with:

    =INDEX('[CMRP10-07.xls]Clutter'!$E:$E,MATCH("*: 1000-5000.19*",'[CMRP10-07.xls]Clutter'!$B:$B,0)+MATCH("*Total for Water*",INDIRECT("'[CMRP10-07.xls]Clutter'!"&"C"&MATCH("*: 1000-5000.19*",'[CMRP10-07.xls]Clutter'!$B:$B,0)+1&":"&"C"&MATCH("*: 1000-5000.19*",'[CMRP10-07.xls]Clutter'!$B:$B,0)+12),0),0)

    I know this is a long string. Is there anyway any of you see to shorten this equation up?

    Thanks for the help!

+ 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