Checking Large Data table for text matched in a row to be selected by an id

rachenk

New Member
Joined
Apr 5, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have a workbook containing a large amount of data that I need to set up to easily analyse if something is not as predicted. Here are some of the sheets I have in the workbook;

Services - a large list of services (more than 250,000 rows) provided (or scheduled) to our clients; each one has the Client's ID number, Date of Service, Service Type, Service Status Column, etc.
Client Contracts - On another sheet, I have a list of all of the Clients and their contract information across the row. The Client ID number is in column GJ, and the types of Services (in text format for the name) we have in their contract/budget to deliver are in the row for the client in Columns CL to GH

I need to work out, for each client if any of the service types listed for them on the Services sheet are not in the Service type list for the client in their row on the Client Contracts Sheet. If there is a Service that was not included in the contract, I need to highlight it or make it in some way for ease of reviewing. This also needs to work in a way that when the data changes on either the services or Client Contracts sheets, it uses the updated data

For example, I need to check if my client Johnny Smith (with ID 1509) has received (or is scheduled to receive) any services that were not negotiated in his contract of service so we can review and contact Johnny to discuss.
 

Attachments

  • Services-smallsample.png
    Services-smallsample.png
    131.6 KB · Views: 9
  • ClientContracts-smallsample.png
    ClientContracts-smallsample.png
    81.6 KB · Views: 9

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi, not so easy with the amount of data you have, and limited data I can see on the ClientContracts sheet. But this my take on a suggestion for you - and it has to be formula based as you want it to auto update with new data. The down side is you have a formula to copy down 250k rows .. but thats a few seconds work once you've set the parameters in the formula I've created.

The absolute data in my sheets (as a copy of your image) might not be perfect, Services sheet is ok, ClientContracts sheet is not clean at all - a result of using .png images to show your problem.

Essentially, I added a Column on the "Services" sheet in "W", which contains the formula.

RESULTS:

client id is not found on the ClientContracts sheet, it inserts "NCC", meaning "No Customer Contract" is setup at all for any service.
client id is matched, but ServiceType is not found on ClientContracts, then it inserts "Not on Contract" (= a review is needed)
client id is matched, and it finds the service on contract sheet, it will leave the cell blank ("") - as no review needed.

Book1
ACDFGHIJLMNOPQRSTUVWX
1ServiceClient IDDateServiceTypeDurationUnitsCANCELStatusHeld ValueClaimedCost/PaReview ?
2168977114924/06/2022.Support Worker (Daily Activlty)7.5HrsA Worker CECA$o.oo000$o.oo$o.oo$o.oo$o.oo $o.oo0% 
3178666150924/06/2022.Sleepover Penalty (Claimed)4Hrsco$o.oo$239.24$239.24$ooo$163.08$o.oo$o.oo$163.08$76.1668%NCC
4179161150924/06/2022.Support Worker (DailyActivity)4Hrsco$o.oo$239.24$239.24$o.oo$145.60$o.oo$o.oo$145.60$9.36461%NCC
5179209150924/06/2022.Sleepover Penalty (Claimed)1Hrsco$o.oo$65.82$65.82$o.oo$40.77$o.oo$o.oo$40.77$25.0562%NCC
6179257150924/06/2022.Sleepover Allowance 01_010_0107_1_18Hrsco$o.oo$242.95$242.95$o.oo$52.86$o.oo$o.oo$52.86$190.0922%NCC
7208909153024/06/2022.Support Worker (DailyActivity) 1:28Hrsco$o.oo$239.20$o.oo-$239.20$152.32$o.oo$o.oo$152.32$86.880%NCC
8189254157824/06/2022ILO Days 01_046_0115_1_1 Complex1Daysco$o.oo$990.28$990.28$o.oo$451.33$o.oo$o.oo$451.33$5.3.99546%NCC
9189506143324/06/2022.Support Worker ( DailyActivity)6Hrsco$o.oo$358.86$358.86$o.oo$190.62$o.oo$o.oo$190.62$168.2453%NCC
10190542143924/06/2022.Support Worker (020) .24hr Shift 24.00 Hß24Hrsco$o.oo$o.oo$o.oo$o.oo$371.78$o.oo$o.oo$371.78-$371.780%NCC
11192829151224/06/2022.Support Worker (Social Community Participat5Hrsco$o.oo$299.05$299.05$ooo$182.oo$o.oo$o.oo$182.oo$117.0561%NCC
12193939152724/06/2022.Support Worker (DailyActivity)4Hrsco$o.oo$239.24$239.24$o.oo$145.60$o.oo$o.oo$145.60$93.6461%NCC
1319420527324/06/2022CB (Improved Life Choice) PM MthlyFee 14_0342Hrsco$o.oo$208.90$208.90$o.oo$o.oo$o.oo$o.oo$o.oo$208.900%Not on Contract
1419731827324/06/2022.SupportWorker (020)4Hrsco$o.oo$o.oo$o.oo$o.oo$127.44$o.oo$o.oo$127.44-$127.440%Not on Contract
15198518145824/06/2022.Sleepover Penalty (Clamed)4Hrsco$o.oo$263.28$263.28$ooo$163.08$o.oo$o.oo$163.08$100.2062%NCC
16198893144924/06/2022.Support Worker (DailyActivity)4Hrsco$o.oo$239.24$239.24$o.oo$o.oo$o.oo$o.oo$o.oo$2.3.2240%NCC
17199176144924/06/2022.Support Worker (DailyActivity)3Hrsco$o.oo$179.43$179.43$o.oo$109.20$o.oo$o.oo$109.20$70.2361%NCC
18201384156424/06/2022SIL Standard Supports5.5HrsNo Worker ACA$o.oo$o.oo$o.oo$o.oo$o.oo$o.oo$o.oo$o.oo$o.oo0%NCC
19201557156424/06/2022SIL Sleepover 01_832_0115_1_18Hrsco$o.oo$243.22$243.22$ooo$52.86$o.oo$o.oo$52.86$190.3622%NCC
20201603156424/06/2022SIL Sleepover Penalty(C1aimed)4Hrsco$o.oo$252.28$252.28$o.oo$163.08$o.oo$o.oo$163.08$89.2065%NCC
21202872144124/06/2022.Support Worker (DailyActivity)3Hrsco$o.oo$179.43$179.43$o.oo$109.20$o.oo$o.oo$109.20$70.2361%NCC
22202977147324/06/2022.Support Worker (Daily Activity)5Hrsco$o.oo$299.05$299.05$o.oo$182.oo$o.oo$o.oo$182.oo$117.0561%NCC
23205379128524/06/2022.Support Worker (DailyActivity)5Hrsco$o.oo$285.50$285.50$ooo$182.oo$o.oo$o.oo$182.oo$103.5064%NCC
24205631128524/06/2022.Support Worker (Social Community Participat2Hrsco$o.oo$126.68$126.68$o.oo$72.80$o.oo$o.oo$72.80$5.38857%NCC
25206055152424/06/2022.Support Coresident (DailyActlvity)7Hrsco$o.oo$277.76$277.76$o.oo$172.20$o.oo$o.oo$172.20$105.5662%Not on Contract
26206363154124/06/2022SIC Standard Supports8Hrsco$o.oo$458.40$458.40$o.oo$291.20$o.oo$o.oo$291.20$167.2064%NCC
27207023126824/06/2022.Sleepover Penalty (Clamed)4.5HrsSU$o.oo$o.oo$o.oo$ooo$o.oo$o.oo$o.oo$o.oo$ooo0% 
28
Services
Cell Formulas
RangeFormula
W2:W27W2=LET(client,XLOOKUP(C2,ClientContracts!GJ$5:GJ$100,ClientContracts!GJ$5:GJ$100,"NCC"),result,FILTER(ClientContracts!CL$5:GJ$100,ClientContracts!GJ$5:GJ$100=client,"NCC"),found,FILTER(result,result=F2,"Not on Contract"),final,IF(result="NCC","NCC",IF(found="Not on Contract",found,"")),UNIQUE(TRANSPOSE(final)))


Book1
FTFUFVFWFXFYFZGAGBGCGDGEGFGGGHGIGJGKGL
1
2Short Term Accommodation} 24 hrShort Term Accommodation] 24Short Term Accommodation} 24 hr$ Short$ Short$ ShoriOSS VersionClient ID.Cost
3Rates/Host Respitehr Rates/Host RespiteRates/Host RespiteTerm AccommodaTerm AccommTerm AccommIncome ratio
4
5.Short Term Accom (Award 24 Hrs)0 Select support type if applicable$16,057.670 Version211.144657%
6Select support type if applicableSelect support type if applicable Select support type if applicable0 Version 2.9164067%
7Select support type if applicableSelectsupportwpe if applicable Select support type if applicable0 Version 2.10.144763%
8.Sleepover Penalty (Clamed)Set (STA) Service Type Here0 Selectsupport type if applicable$0 Version 2.11.126865%
9Select support type if applicableSelect support type if applicable Select support type if applicable$0 Version 2.6163062%
10Select support type if applicableSelect support type if applicable Select support type if applicable0 Version 2.9152965%
11Set (STA) Service Type Here0 Select support type if applicable0 Version 2.11.128145%
12Select support type if applicableSelect support type if applicable Selectsupport type if applicable0 Version 2.1144261%
13Select support type if applicableSelect support type if applicable Select support type if applicable$0 Version 210.159647%
14Select support type if applicableSelect support type if applicable Select support type if applicable0 Version 2.8159168%
15.Short Term Accom (Award 24 Hrs)0 Select support type if applicable$ 1,000.000 Version 2.11.146558%
16Set (STA) Service Type Here0 Selectsupport type if applicable$0 Version 2.11.164158%
17.SupportCoresident (020)Select support type if applicable .Support Coresident (020)$0 Version 2.127365%
18.SupportCoresident (020)Select support type if applicable .Support Coresident (Daily Activiw)00Version 2.127458%
19.Support Worker (Daily Activlty).Host (020)Select support type if applicable Selectsupport type if applicable$0 Version 2.1114967%
20Set (STA) Service Type Here0 Selectsupport type if applicable$0 Version211.152459%
21.Selectsupport type if applicableSelect support type if applicable Select support type if applicable00Version 2.10.147566%
22.Host (020)Selectsupportwpe if applicable Select support type if applicable0 Version 2.21636#N/A
23.Support Worker (020) 24hr ShiftSelect support type if applicable Select support type if applicable$0 Version 2.928961%
24.Select support type if applicableSelect support type if applicable Select support type if applicable00Version 2.10.163371%
25
ClientContracts


Excel Formula:
=LET(client,XLOOKUP(C2,ClientContracts!GJ$5:GJ$100,ClientContracts!GJ$5:GJ$100,"NCC"),result,FILTER(ClientContracts!CL$5:GJ$100,ClientContracts!GJ$5:GJ$100=client,"NCC"),found,FILTER(result,result=F2,"Not on Contract"),final,IF(result="NCC","NCC",IF(found="Not on Contract",found,"")),UNIQUE(TRANSPOSE(final)))

The formula is broken into a few parts by using the LET() function for explanation : You don't see the interim results being generated and used, but heres whats happening.

Excel Formula:
LET(client,XLOOKUP(C2,ClientContracts!GJ$5:GJ$100,ClientContracts!GJ$5:GJ$100,"NCC")
So "client" here will have the result of the search of client id from C2, from ClientContracts sheet. So the result should normally be the "client_id". If id not found, client = "NCC"

Excel Formula:
result,FILTER(ClientContracts!CL$5:GJ$100,ClientContracts!GJ$5:GJ$100=client,"NCC")
"result" will contain the correct client_id row of serviceTypes on contract, or "NCC" if client row not found. (my data on ClientContracts starts row5, and I end on 100 - you may have more clients or less..)

Excel Formula:
found,FILTER(result,result=F2,"Not on Contract")
"found" will filter the "result" data looking for the ServiceType from F2. If the serviceType is not found (ie. it is not on contract), then "found"="Not on Contract". Otherwise "found" contains serviceType name.

Excel Formula:
final,IF(result="NCC","NCC",IF(found="Not on Contract",found,"")),UNIQUE(TRANSPOSE(final)))
"final" is actually what will be shown in Col "W" as your result. So If result="NCC", then is displays "NCC" as first priority eg. no client exists.
otherwise result <>"NCC", so it checks status of "found" and displays "Not on Contract" if the servicetype is not in the list, or puts a "" blank in if it is in the list.
The unique(transpose(final)) bit on the end was to clean up a result that spilled across the page.

Hope it helps, sorry its a bit wieldly, but I couldn't find another way to do it. Ensure your data is in correct columns for formula to work, or adjust formula to your columns...
Rob
 
Upvote 0

Forum statistics

Threads
1,215,202
Messages
6,123,625
Members
449,109
Latest member
Sebas8956

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