I have a somewhat odd need. I have 18 each with 2 sheets (will probably add them into 1 excel file). The sheets are listed by government program and I need to do averages for different programs. The problem is that if NJ doesn't have the program then it gets out. So Education Pensions might be row 45 for NJ but row 47 for NYC. But, each program has a unique identifier. So instead of specifying a sheet, column and row, I want to specify the sheet and column and have a function that repots the row.
Is there a way to do this in Excel 2007?
If you have a common identifier you can use VLOOKUP
=VLookup( value, table_array, index_number, not_exact_match )
Hi and thanks. I've tried vlookup but it doesn't seem to work. The two problems with it are:
1) Some of my identifiers are: "1543.AAA". vlookup gives me an error in searching for that.
2) vlookup doesn't report the row, it reports the value. The problem is I don't want the value in the unique identifer, I want the value two columns to the left of that unique identifier. Is there any way I can get that?
If you could post a sheet it would help.
If you have a unique indetifier and you want to get the value from 2 columns left then you'll need to combine INDEX with MATCH
Post a sheet, let me look.
It sounds like you will be using MATCH, and maybe INDEX (to report the value two columns to the left of your found match). As JJ stated, it would help immensely if you uploaded an example spreadsheet showing examples of your layout and what you want to achieve.
ChemistB
My 2¢
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
Here is the workbook with just two states. For the example problem I'll give I'm looking at sheets: CTFedSpendList and DEFedSpendList.
WILDLIFE HABITAT INCENTIVE PROGRAM
Identififer (column G): 10.914
Connecticut: Row 86
Delaware: Row 78
So, instead of doing CT per capita spending I want to do the per capita spending of CT and DE (don't worry about populations, I can easily make a table for them to draw from) but I want to automat adding the numbers from these programs together across these 2 worksheets even though they are on different rows. (Ultimately, I'm doing 18 states.)
Any help on that would be amazing!
Secondary question: When I moved the CT sheets into the DE file it now looks for USMaster1 on my C:\ Drive... even though the USMaster1 file is the same in both workbooks... is there a way to make it reference sheet in the new workbook?
Thank you
You want to add them?So, instead of doing CT per capita spending I want to do the per capita spending of CT and DE
Something like this?
=INDEX(CTFedSpendList!D:D,MATCH(G86,CTFedSpendList!G:G,0))+INDEX(DEFedSpendList!D:D,MATCH(G86,DEFedS pendList!G:G,0))
Last edited by jj72uk; 11-04-2009 at 02:00 PM.
Ah, interesting. I am getting errors and in trying to narrow it down I just used match (which seems promising).
Matching a value on the same sheet I did "=MATCH(96.006,DEFedSpendListG:G,0)" and it reported row 33 which is correct!
But now I want to add the value in B33 ($323247103)with some other number. How do I do that?
"=SUM(B=MATCH(96.006,DEFedSpendListG:G,0),5)" doesn't seem to work. So I can't combine the column letter that I know and the row number that I get from =Match and put that into a =Sum?
Thanks for your help! It seemed really promising but I can't seem to figure out that one piece.
The reason why it doesnt work if you copy and paste directly is the forum has added a uncanny space.
Try copying this
=INDEX(CTFedSpendList!D:D,MATCH(G86,CTFedSpendList!G:G,0))+INDEX(DEFedSpendList!D:D,MATCH(G86,DEFedSpendList!G:G,0))
I had removed the space and pasting the code also gives me an N/A.
And btw this is exactly what I was looking for. Index works as it should... and so does match... but I can't put a Match inside an index even on the same sheet without it giving me an error. Can you nest a match inside an index?
Last edited by grenavitar; 11-04-2009 at 02:45 PM. Reason: Removed my edit
A nested INDEX MATCH has no problem working together!
I saw before you removed it that you have removed the cell reference with an actual figure, wether numerical or alpha-numerical, this, I think is the problem.
If you just use a cell reference does it work?
Numeric cells such as 10.914 will work fine, if you are using alpha-numeric you will need to add "" to it
eg
"17.FEC"
=Index(B:B,=MATCH(16.571,G:G,0))
For alphanumeric putting in " " is necessary, took me a while to realize that.
Hmmm, I just saw yours work. I'm not sure how or what I did but the nesting worked with no problem. I'm going to compare it to what I did wrong and hopefully find the answer that will work over all cases. Thank you _very_ much for your help!
EDIT: And one other question.
If the number doesn't exist on a sheet it gives me #N/A. Is there any way to make numbers that don't come up as 0 so when they are added up instead of making the function not work?
Last edited by grenavitar; 11-04-2009 at 04:01 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks