Which group is my valu in?

osianap

New Member
Joined
Jun 13, 2010
Messages
5
Cells A1:A4 (group 1) contain the values 1, 2, 3, 4
Cells B1:B4 (group 2) contain the values 5, 6, 7, 8
Cells C1:C4 (group 3) contain the values 9, 10, 11, 12

Cell A6 contains my variable value - use for example 7.
Cell B6 should contain the value "2", because 7 is in group 2.

My question: What is the best formula in cell B6? No VB scripting please!


P.S.: It is safe to assume that all groups are mutually exclusive (i.e. no single digit exists in more than one group).
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Maybe:

=MIN(IF(A1:C4=A6,COLUMN(A1:C4)))
Confirmed with Control+Shift+Enter
 
Upvote 0
Hi,

Another way:


Excel 2010
ABCD
1Group123
2159
32610
43711
54812
6
772
Sheet1
Cell Formulas
RangeFormula
C7=SUMPRODUCT((B2:D5=B7)*(B1:D1))
 
Last edited:
Upvote 0
ABC
1Group 1Group 2Group 3
2159
32610
43711
54812
6
7Variable ValueCorresponding Group
87

<tbody>
</tbody>


In cell B2 type in =INDEX(A1:C1,SUMPRODUCT(COLUMN(A2:C5)*(A2:C5=A8)))

It will return Group 2
 
Upvote 0

Forum statistics

Threads
1,215,361
Messages
6,124,497
Members
449,166
Latest member
hokjock

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