Question About Lookup when Both Column and Row are Variables

Chris Chandler

New Member
Joined
Dec 13, 2013
Messages
4
Greetings!

I have a conundrum regarding a bit of data validation that I'm developing. The purpose is to determine if, on a particular row of data, a specific text string exists. The text string could be found in any column past the first. For example:

Namevariable 1variable 2variable 3variable 4variable 5variable 6variable 7variable 8variable 9
Mikecoupon
Joediscountcouponrefund
Georgerefund
Ericcouponrefundpamphletmediaposteronline
Haroldonline
Johnmediaposter
Kenfriendonlinecoupon
Adammedia
Bobrefundpamphlet

<tbody>
</tbody>


The variables are selected from drop-down lists, and can be found at any point along the row. What I need to determine is when a particular Name has a particular variable in his range. I have one cell that holds the name to be found, and another that holds the variable to be found. If that name's row has the variable in question, I'd like to be able to identify it. For example, how can I determine if Eric has a pamphlet associated within his variables?

I've tried the Index-Match-Match method, and I can't get the column to be determined by the specific row I need. I can easily find Eric's row with Match:

=MATCH(K1,A:A,0)

Where K1 is the cell that holds the name for which I'm looking. This would return "5", which is just what I want. This cell changes value, depending on criteria elsewhere in the workbook.

Now, my problem is that I can't figure out how to use a similar MATCH clause, referencing row 5 (which can easily change to another row) for the lookup column, because (by design), the column can't be predicted, and so the header is of no use, because any one of the nine headers could be one of several variables. I would like to point out that a particular row would only have a particular variable once. Eric wouldn't ever see "Pamphlet" thrice, for example, only the one time.

Note that this is a simplified distillation of my sheet, which has several hundred rows (all with distinct names) and dozens of variables across 20 columns. Please don't get caught up in the example, but rather on how to determine, "Yes,the variable for which you are looking is indeed within the row range of the Name you selected."

Thanks so much for your consideration!

-Chris
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Something like this maybe:

Excel Workbook
ABCDEFGHIJKLM
1Namevariable 1variable 2variable 3variable 4variable 5variable 6variable 7variable 8variable 9NameJoe
2MikecouponVariableCoupon
3JoediscountcouponrefundFormulaYes variable exists
4Georgerefund
5Ericcouponrefundpamphletmediaposteronline
6Haroldonline
7Johnmediaposter
8Kenfriendonlinecoupon
9Adammedia
10Bobrefundpamphlet
Sheet1
 
Upvote 0
FormR -

I swear I tried a countif-index-match before, but not once did I try to give the column a range of "0". Excellent! This works like a charm. I was really worried I was going to bog things down with a heavy array formula. Thanks for the swift reply!

-Chris
 
Upvote 0
FormR -

I swear I tried a countif-index-match before, but not once did I try to give the column a range of "0". Excellent! This works like a charm. I was really worried I was going to bog things down with a heavy array formula. Thanks for the swift reply!

-Chris

You're welcome - (as I'm sure you have now figured out) zero can be used to tell the index function to return all the values in the row and/or column of the array.
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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