# populating columns

I have filled out a sample to help better understand what I am trying to accomplish.  I need the "report" sheet to query the test scores for the tst cde listed in the "database" sheet according to the id Num.  So back to my example in the report sheet you will see for ID 229041927 I manually populate the tst score in the respective tst cde that are listed horizontally in row 1 of the "report" sheet this is what I would like a formula written for.

Thanks
book1.xls
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Microsoft Excel ExpertCommented:
book1.xls
Microsoft Excel ExpertCommented:
if you want to do it yourself  simply put this formula
``````=IFERROR(INDEX(DATA!\$H\$2:\$H\$717, SMALL(IF(RIGHT(\$A2,LEN(\$A2)-2)=DATA!\$A\$2:\$A\$717&"", ROW(DATA!\$A\$2:\$A\$717)-MIN(ROW(DATA!\$A\$2:\$A\$717))+1, ""), COLUMN(A1))),"")
``````
into the D2 and press control shift enter and then copy the formula and paste it in range D2:K163 and that is it.
Information Systems SpecialistAuthor Commented:
Perfect thanks!
Information Systems SpecialistAuthor Commented:
Does the number of digits in the ID column make a difference?  I changed the id number for the sake of privacy when I posted the sheet.  Thought it would just be matter of the ID number matching but when I plug in the actual ID numbers which contain 7 digits the formula stops working.
Information Systems SpecialistAuthor Commented:
I also noticed that the test scores are populating in the correct corresponding test column
Microsoft Excel ExpertCommented:
how does your actual data look like?
Information Systems SpecialistAuthor Commented:
The only difference between the actual and the real is the ID numbers (column a) are different they are 7 digits rather than the 11 in the sheet.  I also noticed the tst_score isn't populating in correct column for the tst_cde
Microsoft Excel ExpertCommented:
can you please explain in layman’s words

the how many char  is the lookup values which is in REPORT Sheet?

How many char is the lookup range in DATA sheet?
Information Systems SpecialistAuthor Commented:
there will be 7 characters on both, a normal ID # is 9050231.
Information Systems SpecialistAuthor Commented:
I see now there is an extra set of 2's added between the sheets.  all the id numbers in the end have just 7 characters, so the section of the formula that is taking 2 away to get them all the same, that can come off.  The id numbers on the final sheet those are all the same format in both the Data and report sheets
Information Systems SpecialistAuthor Commented:
I corrected the ID so they have the same number of characters in both sheets & filled in the first entry of report sheet manually so you can see the effect of what I want to happen
Copy-of-book1.xls
Microsoft Excel ExpertCommented:
Ok.  now, i understood what you were really looking for.   your question wasn't clear at the first time.

Copy-of-book1.xls

Experts Exchange Solution brought to you by