Find an item by searching bottom up

Natit

Board Regular
Joined
Jan 22, 2012
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Hi,
I'm looking for the formula that will get me the Group (cell H2), when I enter the Cat. num (cell F2)
Thx
Nati



שאלה לתפוז.xlsx
ABCDEFGH
1GroupItemCat. NumCat. NumItemGroup
2aa9044a7??
3a117
4a235
5a341
6a439
7a512
8a618
9a744
10ff73
11f11
12f25
13f32
14f44
15bb55
16b123
17b224
18b325
19b414
20b515
21b650
22b751
23aa23
24a248
25a2920
26a349
גיליון1
Cell Formulas
RangeFormula
G2G2=INDIRECT("b"&MATCH(F2,C:C,0))
Cells with Data Validation
CellAllowCriteria
F2List=$C$3:$C$26
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
G2:
From top
Code:
=INDEX($B$3:$B$26,MATCH(F2,$C$3:$C$26,0))
or from bottom
Code:
=INDEX($B$3:$B$26,MATCH(F2,$C$3:$C$26,0))

H2, from top
Code:
=LOOKUP("ZZZ",INDEX(A2:OFFSET(A2,MATCH(F2,$C$3:$C$26,0),),))
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

I would also avoid using volatile functions like INDIRECT and OFFSET if there are viable alternatives.

IF you have MS 365 then you could replace the G2 formula with the one shown below. If no 365 then there are other non-volatile suggestions in post #2.

I have also included a non-volatile suggestion for H2

22 02 23.xlsm
ABCDEFGH
1GroupItemCat. NumCat. NumItemGroup
2aa9044a7aa90
3a117
4a235
5a341
6a439
7a512
8a618
9a744
10ff73
11f11
12f25
13f32
14f44
15bb55
16b123
17b224
18b325
19b414
20b515
21b650
22b751
23aa23
24a248
25a2920
26a349
Lookup
Cell Formulas
RangeFormula
G2G2=XLOOKUP(F2,C:C,B:B)
H2H2=LOOKUP("zzz",A2:INDEX(A:A,MATCH(F2,C:C,0)))
 
Upvote 0
Solution
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

I would also avoid using volatile functions like INDIRECT and OFFSET if there are viable alternatives.

IF you have MS 365 then you could replace the G2 formula with the one shown below. If no 365 then there are other non-volatile suggestions in post #2.

I have also included a non-volatile suggestion for H2

22 02 23.xlsm
ABCDEFGH
1GroupItemCat. NumCat. NumItemGroup
2aa9044a7aa90
3a117
4a235
5a341
6a439
7a512
8a618
9a744
10ff73
11f11
12f25
13f32
14f44
15bb55
16b123
17b224
18b325
19b414
20b515
21b650
22b751
23aa23
24a248
25a2920
26a349
Lookup
Cell Formulas
RangeFormula
G2G2=XLOOKUP(F2,C:C,B:B)
H2H2=LOOKUP("zzz",A2:INDEX(A:A,MATCH(F2,C:C,0)))
Hi Peter,
The formula in G2 works perfect.
The formula in H2, gave me an error and it took me almost an hour to find out why.
My Office version is not in English so the formula gave me an error with the "zzz" letters.
When I replaced it with characters in my language, it worked great.
Thx a lot
Nati

I even simplified it (for testing) as "=lookup("zzz", a2:a25)", and it also gives me an error.
 
Upvote 0
When I replaced it with characters in my language, it worked great.
Good news. Not sure what you replaced the "zzz" with but it needs to be some text that would come after any other text you might have in the column if it was sorted alphabetically.

The formula in G2 works perfect.
That indicates that you have MS 365 or later. It would still help in the future if you included that information in your account details as I suggested earlier so it was always available to helpers. ;)
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

1645653921289.png
 
Upvote 0

Forum statistics

Threads
1,216,773
Messages
6,132,622
Members
449,740
Latest member
tinkdrummer

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