retrieving column number out of a sheet

Gold_fingers_95

New Member
Joined
May 3, 2015
Messages
5
Hello everyone,
I have listed car brands in a sheet and distributed them on several columns. (as follows)

A10A11A12A13A14
1GRADE 1GRADE 2GRADE 3GRADE 4GRADE 5
2LexusChevroletAudiAlfa RomeoChery
3NissanDodgeBMWCitroenChrysler
4MitsubishiGMCCadillacDaihatsuDongFeng
5SuzukiHondaFordHyundaiFiat
6ToyotaHummerJaguarGeely
7InfinitiJeepIsuzu
8Land RoverKiaLancia
9Mercedes-BenzMazdaMINI
10PorschePeugeotSaab
11RenaultSsangYongVolvo
12VolkswagenSubaru

<tbody>
</tbody>


My concern is to get in a cell the "Grade" in which the brand exists. (e.g if I type "Dodge" in a specific cell, I should get GRADE 2 or the concerned column number "2")

Thanks in advance guys ;)
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Row\Col
A​
B​
C​
D​
E​
F​
G​
1​
**GRADE 1**GRADE 2**GRADE 3**GRADE 4**GRADE 5**Dodge
2​
**Lexus**Chevrolet**Audi**Alfa Romeo**CheryGRADE 2
3​
**Nissan**Dodge**BMW**Citroen**Chrysler
4​
**Mitsubishi**GMC**Cadillac**Daihatsu**DongFeng
5​
**Suzuki**Honda**Ford**Hyundai**Fiat
6​
**Toyota****Hummer**Jaguar**Geely
7​
******Infiniti**Jeep**Isuzu
8​
******Land Rover**Kia**Lancia
9​
******Mercedes-Benz**Mazda**MINI
10​
******Porsche**Peugeot**Saab
11​
******Renault**SsangYong**Volvo
12​
******Volkswagen**Subaru

G2, control+shift+enter, not just enter:

=IFERROR(INDEX($A$1:$E$1,1/(1/MAX(IF($A$2:$E$12=G1,COLUMN($A$1:$E$1)-COLUMN($A$1)+1)))),"")
 
Upvote 0
Thank you for the quick reply! It's just... ...perfect :D
Just for info, what type of function is that?

Row\Col
A​
B​
C​
D​
E​
F​
G​
1​
**GRADE 1**GRADE 2**GRADE 3**GRADE 4**GRADE 5**Dodge
2​
**Lexus**Chevrolet**Audi**Alfa Romeo**CheryGRADE 2
3​
**Nissan**Dodge**BMW**Citroen**Chrysler
4​
**Mitsubishi**GMC**Cadillac**Daihatsu**DongFeng
5​
**Suzuki**Honda**Ford**Hyundai**Fiat
6​
**Toyota****Hummer**Jaguar**Geely
7​
******Infiniti**Jeep**Isuzu
8​
******Land Rover**Kia**Lancia
9​
******Mercedes-Benz**Mazda**MINI
10​
******Porsche**Peugeot**Saab
11​
******Renault**SsangYong**Volvo
12​
******Volkswagen**Subaru

<tbody>
</tbody>


G2, control+shift+enter, not just enter:

=IFERROR(INDEX($A$1:$E$1,1/(1/MAX(IF($A$2:$E$12=G1,COLUMN($A$1:$E$1)-COLUMN($A$1)+1)))),"")
 
Upvote 0
Thank you for the quick reply! It's just... ...perfect :D
Just for info, what type of function is that?

MAX would return 0 when it fails,i.e., when what it looks for is not available. Correlating 0 with the range INDEX is referencing would deliver the first element of that range. Such is of course obviously false. Using:

1/(1/MAX(...))

we get #DIV/0! if MAX fails or we get the MAX value back:

Suppose MAX = 4.

1/(1/(4))

==> 4

Thus: MAX = 0 ==> #DIV/0! or MAX = n ==> n.

Feeding the result to IFERROR allows using the foregoing relational feature.
 
Upvote 0
Just for info, what type of function is that?
I read your question differently than Aladin did. I think you were asking about formulas that are committed with CTRL+SHIFT+ENTER, so I'll answer that one. They are called "array formulas" and here is a link that will give you more information about them...

Array Formulas
 
Upvote 0

Forum statistics

Threads
1,215,181
Messages
6,123,513
Members
449,101
Latest member
mgro123

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