Index Match with Constant Row and Variable Columns

HawaiianShirts

New Member
Joined
Jul 19, 2014
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I'm creating a worksheet (Data) that will reference another (Sheet1). In Sheet1, the data will change periodically by being pasted in from a form filled out by someone else. The trouble is that the form has three versions, and each version has a slightly different number of columns. I need to compile the data from any version into a single table for exporting to another program. I would like to use Index/Match with a constant row reference and a variable column reference, if it's possible. There must be something I don't understand because it's not working.

Sheet1 might have one of these three column name variations in E15-I15:
CountyStateContract NumberAmountDate
CityCountyStateContract NumberAmount
CityOrganizationContract NumberAmountDate

So, in the Data worksheet, I have all the possible column names listed.
CityCountyStateOrganizationContract NumberAmountDate

Knowing that all the data I wanted to appear in Row 2 of the Data worksheet would be in Rows 16-31 of Sheet1, I thought I could use Index/Match with the row number as a constant. Like this:
=INDEX(Sheet1!$16:$31,16,MATCH(Data!A$1,Sheet1!$15:$15,0))

Saying, "Look in all of these rows, then pick the value in Row 16 where you find this column name above it."
Then I could copy that down the rows and to get the values from 17, 18, 19, and so on.

But the result I get is just 0. That tells me Excel can't find the thing I told it to look for, but I can't figure out why. Any ideas?

(I've searched for similar questions, but I didn't find any that quite fit my situation, which is odd because it hardly seems unique...)
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
You didn't need to match a row number, the row you want the data from is the Index range.

In your formula you had indexed rows 16 to 31 & told it to return data from row 31 as that is the 16th row in that range.

=INDEX(Sheet1!$16:$31,16,MATCH(Data!A$1,Sheet1!$15:$15,0))
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,215
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top