Max value lookup, using comma separated lookup cell (Formula, not VB please)

Cwillson

New Member
Joined
Oct 1, 2015
Messages
36
Office Version
  1. 2019
Platform
  1. Windows
Hello Peeps!

I have a table called "customers" arranged as below;

CustIDDate
125/01/21
326/07/20
412/01/21
516/07/20
81/10/20

I have another separate table called "organisations" as below;

OrgIDOrgCustIDMostRecentDate
5091
6993, 4, 5
7008

I'm looking for a formula which will populate the MostRecentDate column in this table with the MAX date from all associated rows in the "customers" table, using the comma separated values in OrgCustID. Ugh!

Solution needs to be a formula rather than VBS I'm afraid.

Many thanks in advance! :)
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
And you want get results in MostRecentDate also separate by comma in case of 2 or more IDs in OrgCustID column?
 
Upvote 0
Sorry, I've missed that.

With array formula (works in xl 365):
Book1
ABCDE
1CustIDDateOrgCustIDMostRecentDate
2125/01/2021125/01/2021
3326/07/20203, 4, 526/07/2020
4412/01/2021801/10/2020
5516/07/2020
6801/10/2020
Sheet1
Cell Formulas
RangeFormula
E2:E4E2=MAX(IF(ISNUMBER(MID(D2,ROW($1:$10),1)*1),VLOOKUP(MID(D2,ROW($1:$10),1)*1,$A$1:$B$6,2,0),0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
What version of Excel are you using?

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’)
 
Upvote 0
What version of Excel are you using?

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’)
Apologies for the omission! I'm using Excel 2019 desktop.
 
Upvote 0
Sorry, I've missed that.

With array formula (works in xl 365):
Book1
ABCDE
1CustIDDateOrgCustIDMostRecentDate
2125/01/2021125/01/2021
3326/07/20203, 4, 526/07/2020
4412/01/2021801/10/2020
5516/07/2020
6801/10/2020
Sheet1
Cell Formulas
RangeFormula
E2:E4E2=MAX(IF(ISNUMBER(MID(D2,ROW($1:$10),1)*1),VLOOKUP(MID(D2,ROW($1:$10),1)*1,$A$1:$B$6,2,0),0))
Press CTRL+SHIFT+ENTER to enter array formulas.
Thanks Kokosek. :)

I'm trying to implement this in my workbook (I only provided sample data on here) but am a little perplexed as to how the ROW syntax is being used within the MID function.
 
Upvote 0
In that case, how about
+Fluff 1.xlsm
AB
1CustIDDate
2125/01/2021
3326/07/2020
4412/01/2021
5516/07/2020
6801/10/2020
7123/01/2021
8830/10/2020
Sheet1


+Fluff 1.xlsm
ABC
1OrgIDOrgCustIDMostRecentDate
2509125/01/2021
36993, 4, 512/01/2021
4700830/10/2020
Sheet2
Cell Formulas
RangeFormula
C2:C4C2=MAX(MAXIFS(Sheet1!$B$2:$B$10,Sheet1!$A$2:$A$10,FILTERXML("<k><m>"&SUBSTITUTE(B2,",","</m><m>")&"</m></k>","//m")))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
In that case, how about
+Fluff 1.xlsm
AB
1CustIDDate
2125/01/2021
3326/07/2020
4412/01/2021
5516/07/2020
6801/10/2020
7123/01/2021
8830/10/2020
Sheet1


+Fluff 1.xlsm
ABC
1OrgIDOrgCustIDMostRecentDate
2509125/01/2021
36993, 4, 512/01/2021
4700830/10/2020
Sheet2
Cell Formulas
RangeFormula
C2:C4C2=MAX(MAXIFS(Sheet1!$B$2:$B$10,Sheet1!$A$2:$A$10,FILTERXML("<k><m>"&SUBSTITUTE(B2,",","</m><m>")&"</m></k>","//m")))
Press CTRL+SHIFT+ENTER to enter array formulas.

Hmmm, I have named ranges for Sheet1!$B$2:$B$10 and Sheet1!$A$2:$A$10 and have substituted these in the array formula. I've updated B2 to my comma separated lookup cell, and definitely entered it as a array formula, but am getting a #VALUE! error... :(
 
Upvote 0
Can you post a sample of your data showing the formula that you used.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,215,576
Messages
6,125,633
Members
449,242
Latest member
Mari_mariou

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