Formula: Search for value in range, but equal to specific text

DarkSmile

Board Regular
Joined
Feb 22, 2021
Messages
90
Office Version
  1. 365
Platform
  1. Windows
Hello,

It's really hard to try to explain what I want (in my head it's so clear ? ) In a previous post I asked for a formula to search for the biggest value equal to cell B4.
Now I would like to do the following:

B13 has the output of the biggest value. I would like to search for that output in cell A21:B31 and tell me which category is equal to that value, but only look/search for the values equal to B4

Example: Here he can only choose between A, F & K to see wich one equals 12.
1614865706556.png


If multiple correct options just take it in alphabetic order.

TCA berekening.xlsm
AB
3Parameters : ISO 22000:2018
4Categorieën?: A, F, K,
5
6Aantal HACCP-plannen?:
7Aantal FTE's?:
8Extra site(s)?:
9N/A
10
11Haalt comma's wegA F K
12Grootste CAT
13Grootste CAT (uren)12
14
15
16
17
18
19
20CategorieënTe besteden mandagen (uren)
21A6
22B6
23C12
24D12
25E8
26F8
27G8
28H8
29I8
30J8
31K12
ISO22000
Cell Formulas
RangeFormula
A9A9=IF(B8="Ja",'ISO22000'!$F$36,"N/A")
B11B11=SUBSTITUTE(B4,",","")
B13B13=AGGREGATE(14,6,(SEARCH('ISO22000'!$A$21:$A$31,B4)>0)*('ISO22000'!$B$21:$B$31),1)
Named Ranges
NameRefers ToCells
ISOOutput='ISO22000'!$B$4B13, B11
Cells with Data Validation
CellAllowCriteria
B6List=HACCPISO22000
B7List=FTEISO22000
B8List=ExtraSiteISO
B9List=AantalSitesISO
 
Excel Formula:
=INDEX(A25:A35;AGGREGAAT(15;6;(VIND.SPEC(A25:A35;B4)>0)*(B25:B35=B12)*(RIJ(A25:A35)-24);1))&" "&ALS.FOUT(INDEX(A25:A35;AGGREGAAT(15;6;(VIND.SPEC(A25:A35;B4)>0)*(B25:B35=B12)*RIJ(A25:A35)-24;2));"")&" "&ALS.FOUT(INDEX(A25:A35;AGGREGAAT(15;6;(VIND.SPEC(A25:A35;B4)>0)*(B25:B35=B12)*RIJ(A25:A35)-24;3));"")
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
VBA Code:
=ALS.FOUT(INDEX(A25:A35;AGGREGAAT(15;6;((1/((VIND.SPEC(A25:A35;B4))*(B25:B35=B12))>0))*(RIJ(A25:A35)-24);1));"")&" "&ALS.FOUT(INDEX(A25:A35;AGGREGAAT(15;6;((1/((VIND.SPEC(A25:A35;B4))*(B25:B35=B12))>0))*(RIJ(A25:A35)-24);2));"")&" "&ALS.FOUT(INDEX(A25:A35;AGGREGAAT(15;6;((1/((VIND.SPEC(A25:A35;B4))*(B25:B35=B12))>0))*(RIJ(A25:A35)-24);3));"")
 
Upvote 0
VBA Code:
=ALS.FOUT(INDEX(A25:A35;AGGREGAAT(15;6;((1/((VIND.SPEC(A25:A35;B4))*(B25:B35=B12))>0))*(RIJ(A25:A35)-24);1));"")&" "&ALS.FOUT(INDEX(A25:A35;AGGREGAAT(15;6;((1/((VIND.SPEC(A25:A35;B4))*(B25:B35=B12))>0))*(RIJ(A25:A35)-24);2));"")&" "&ALS.FOUT(INDEX(A25:A35;AGGREGAAT(15;6;((1/((VIND.SPEC(A25:A35;B4))*(B25:B35=B12))>0))*(RIJ(A25:A35)-24);3));"")
This one works! Here is the translation if someone ever needs it:
Excel Formula:
=IFERROR(INDEX(A25:A35,AGGREGATE(15,6,((1/((SEARCH(A25:A35,B4))*(B25:B35=B12))>0))*(ROW(A25:A35)-24),1)),"")&" "&IFERROR(INDEX(A25:A35,AGGREGATE(15,6,((1/((SEARCH(A25:A35,B4))*(B25:B35=B12))>0))*(ROW(A25:A35)-24),2)),"")&" "&IFERROR(INDEX(A25:A35,AGGREGATE(15,6,((1/((SEARCH(A25:A35,B4))*(B25:B35=B12))>0))*(ROW(A25:A35)-24),3)),"")

Also, this works too for what I was trying (found it later than your reply)
Excel Formula:
Shows Cat (F)

=INDEX(CatISO22000,MATCH(H3,(ISNUMBER(SEARCH(CatISO22000,ISOOutput2))*(B21:B31)),0))

Shows Number (12)

=MAX(ISNUMBER(SEARCH(CatISO22000,ISOOutput2))*$B$21:$B$31)
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,432
Members
448,961
Latest member
nzskater

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