Particular Indirect and Match formula

richard1234567891011

Board Regular
Joined
Feb 21, 2018
Messages
91
Hi Guys,

I need help in order to change the indirect match formula, I have these data to Match.


Values
Roma Sub 185000
Pisa Sub 98 - 287176700
Pisa Sub 59 - 204 - 266240000
Pisa Sub 127 - 258178900
Pisa Sub 101-185-186385000
Pisa Sub 18817900
Pisa Sub 124 - 261178900
Pisa Sub 283 - 28432200
Pisa Sub 36 - 233207400
Pisa Sub 30 - 254 - 255317000
Pisa Sub 34 - 197 - 282251800
Pisa Sub 94 - 257170000
Pisa Sub 90-275191000
Pisa Sub 58 - 202 - 203332000
Paderno Sub 29 - 154295000
Firenze Sub 28 - 42145000
Firenze Sub 26 - 44148000

<tbody>
</tbody>

In the other table, I have these:

Sub
Roma1
Pisa101
Pisa185
Pisa186
Pisa30
Pisa20
Pisa10
Pisa124
Pisa254
Pisa255
Pisa94
Pisa102
Pisa103
Pisa104
Pisa105
Pisa106
Pisa107
Pisa108
Pisa109
Pisa110
Pisa98
Pisa287

<tbody>
</tbody>


I have to take the values from the first table based on the values (Sub and City) of the second one.

Thank you guys,
 
so take second table (post#1) and merge (whatever method) with the table (post#6) with the result: City/Sub/Value

edit:
table (post#6) is the same as first table (post#1) but detailed to one city one sub

You Are stuck with this idea of merging tables, this is not what I am asking,

I cannot merge, I need a formula,

Thank you,
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
you can merge via PowerQuery

if you want formula - I can't help

have a nice day
 
Upvote 0
Thanks for your reply. I see what you are trying to do but your data layout is making this very difficult. Are there options to split the data in the first table? Let me explain why. Let's say I'm trying to match both Pisa and 10. The way the data is organised in the first table with the city and code(s) as a string in a single cell means that if I try to match Pisa+10 then the formula will not be able to tell the difference between say Pisa 10 - 20 and Pisa 101 - 201. In finding Pisa+10 it would get an incorrect match with Pisa+101 (I know that data does not exist yet, it is an example). Best practice would be to have different pieces of data in separate columns, rather than all being in 1 column.

The options from here are:
1) a VBA custom function to do the match
2) splitting the data in the first table so that it is almost normalised (each column has it's own piece of data, not multiple pieces of data)
3) using a number of helper columns in the first table to achieve the same effect as number 2 if number 2 is not possible.

How much data is there? Are you using the Excel Tables functionality? Lastly, are you entering the data or is it being sourced from somewhere else?
 
Last edited:
Upvote 0
I agree with Andrew that it's better to split out the individual fields into separate columns. But if that's not an option (imported data), then this might work:


Book1
ABCDEF
1ValuesCitySubResult
2Roma Sub 185000Roma185000
3Pisa Sub 98 - 287176700Pisa101385000
4Pisa Sub 59 - 204 - 266240000Pisa185385000
5Pisa Sub 127 - 258178900Pisa186385000
6Pisa Sub 101-185-186385000Pisa30317000
7Pisa Sub 18817900Pisa200
8Pisa Sub 124 - 261178900Pisa100
9Pisa Sub 283 - 28432200Pisa124178900
10Pisa Sub 36 - 233207400Pisa254317000
11Pisa Sub 30 - 254 - 255317000Pisa255317000
12Pisa Sub 34 - 197 - 282251800Pisa94170000
13Pisa Sub 94 - 257170000Pisa1020
14Pisa Sub 90-275191000Pisa1030
15Pisa Sub 58 - 202 - 203332000Pisa1040
16Paderno Sub 29 - 154295000Pisa1050
17Firenze Sub 28 - 42145000Pisa1060
18Firenze Sub 26 - 44148000Pisa1070
19Pisa1080
20Pisa1090
21Pisa1100
22Pisa98176700
23Pisa287176700
Sheet11
Cell Formulas
RangeFormula
F2=IFERROR(AGGREGATE(15,6,$B$2:$B$18/ISNUMBER(SEARCH(D2,$A$2:$A$18))/ISNUMBER(SEARCH(" "&E2&" ",SUBSTITUTE($A$2:$A$18,"-"," ")&" ")),1),0)
 
Upvote 0

Forum statistics

Threads
1,215,208
Messages
6,123,642
Members
449,111
Latest member
ghennedy

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