Duplicate Conditional Formatting with non-exact search inquiry

ashtons

New Member
Joined
Jul 1, 2024
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hello,

I'm not especially experienced with Excel, and haven't been able to find someone with my situation online to help troubleshoot my problem.

It's a complicated situation in a somewhat specialized field, so I'll try to explain as best as possible.

I work in medical billing, and there is a specific insurance payer who has strict rules about what ICD 10 diagnosis codes are allowed to be billed together (i.e. the code for chronic pain basically excludes any other pain codes, etc. meaning if a chronic pain code and a leg pain code are billed together, the insurance will deny.) We have a running list of codes that can't be billed together, but I wanted to make an easier "lookup" style excel sheet where we could essentially 1. input all the codes on the claim and have the sheet highlight codes that have exclusions and 2. search codes one at a time to isolate codes that exist on the claim that need removal because they can't be billed with the searched code.

The first part I've managed just fine with conditional formatting and a COUNTIF formula, so any codes on the claim that are "headers" in the table of codes and exclusions highlight red.

The second part is where I've run into trouble. ICD 10 codes exist in a range of fewer digits/less specific to more digits/more specific (For example, M17 (osteoarthritis of knee) at its least specific, to M17.32 (unilateral post-traumatic osteoarthritis, left knee). Some codes have up to 7 digits, and dozens if not hundreds of variations/sub codes). But, in the case of codes that are mutually exclusive, if a code excludes M17, then any codes more specific (M17.0, M17.32, etc.) are also excluded. The claims usually have more specific codes, but the table of exclusions usually has the least specific code that is still an exclusion. Since conditional formatting doesn't like wildcards, I've found that the hidden helper table will highlight duplicates using the wildcard, but the more specific codes in the column I'm actually trying to format will not highlight. Is there a way to finagle this to make it work? (Preferably without listing out every single code under the least specific code).

Here's the sheet, I'm hoping I've formatted this as well as explained it correctly. Thanks in advance
Colvin diagnosis exclusion lookup.xlsx
BCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
2DX CODES ON YOUR CLAIMDX code excluded by search term (this colum is supposed to be hidden!)->*ONE* RED DX CODE HERECODES
3M81.0F45.41g89.4G89.21G89.29G89.3G89.4I73.89K08.89K86.3M15.0M25.551M25.552M25.561M25.562M54.08M54.12M54.16M54.2M54.59M54.6M79.641M79.642M81.0R25.2R53.1R53.81S88.112DS88.112SZ79.891
4G89.4G43.*Codes they excludeF45.41F45.41F45.41F45.41E08.51M26.*D13.7M16.*M20.*M20.*M20.*M20.*F45.41H45.41F45.41F45.41F45.41F45.41F45.41F45.41M80.*F95.*M62.81F33S98.*S98.*F1*
5R53.81G44.*G43.*G43.*G43.*G43.*E08.52M27.*E84.*M17.*M21.*M21.*M21.*M21.*L93.2M47.2*M47.2*M50.*M51.2*M51.*F45.8F45.8M89.0F98.4M62.84F43.0O99.32*
6Z79.891G50.1G44.*G44.*G44.*G44.*E09.51K90.3M18.*M26.6*M26.6*M26.6*M26.6*M35.6M50.1*M50.1M54.4*M25.5*M25.5*G2*R54O26.8*
7m48.061G54.6G50.1G50.1G50.1G50.1E09.52M19.*M65.2*M65.2*M65.2*M65.2*M79.3M51.1*M51.1*S39.012G40.4
8M25.561H57.1G54.6G54.6G54.6G54.6E10.51M71.4*M71.4*M71.4*M71.4*M79.2*M79.2*M62.830
9m25.562H92.0G56.4*G56.4*H57.1H57.1E10.52M75.3*M75.3*M75.3*M75.3*M62.831
10m25.532K08.8G57.7G57.7*H92.0*H92.0E11.51M79.6*M79.6*M79.6*M79.6*R29.0
11m54.12K14.6THIS MEANS I HAVE EXCLUSIONS AND YOU SHOULD SEARCH FOR ME!G89.0G89.0K08.8K08.8E11.52R26.*R26.*R26.*R26.*
12m54.16M25.5*G89.3G89.3K14.6K14.6E12.51
13m54.59M54.*G89.4G89.4M25.5*M25.5*E12.52
14M79.1*G90.5*G90.5*M54.*M54.*E13.51
15M79.6*H57.1H57.1M79.1*M79.1*E13.52
16N23H92.0*H92.0M79.6*M79.6*G45.9
17N64.4K08.8K08.8M23N23T33.*
18N94.81*THIS MEANS I AM AN EXCLUSION AND YOU SHOULD DELETE ME!K14.6K14.6M64.4N64.4T34.*
19R07.*M25.5*M25.5*N94.81*N94.81*T69.0*
20R10.*M54.*M54.*R07.*R07.*T69.1*
21R30.9M79.1*M79.1*R10.*R10.*
22R51.9M79.6*M79.6*R30.9R30.9
23R52N23N23R51.9R51.9
24T82.84N64.4N64.4R52R52
25T83.84N94.81*N94.81*T82.84T82.84
26T84.84R07.*R07.*T83.84T83.84
27T85.84R10.*R10.*T84.84T84.84
280R10.2R10.2T85.84*T85.84
290R30.9R30.9
300R51.9R51.9
310R52R52
320T82.84T82.84
330T83.84T83.84
340T84.84T84.84
35T85.84*T85.84*
LOOKUP
Cell Formulas
RangeFormula
C3:C34C3=XLOOKUP(D3,F3:AF3,F4:AF35,"N/A",2)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:C34Cell ValueduplicatestextNO
B3Expression=COUNTIF($F$3:$AF$3,B3)textNO
B4Expression=COUNTIF($F$3:$AF$3,B4)textNO
B5Expression=COUNTIF($F$3:$AF$3,B5)textNO
B6Expression=COUNTIF($F$3:$AF$3,B6)textNO
B7Expression=COUNTIF($F$3:$AF$3,B7)textNO
B8Expression=COUNTIF($F$3:$AF$3,B8)textNO
B9Expression=COUNTIF($F$3:$AF$3,B9)textNO
B10Expression=COUNTIF($F$3:$AF$3,B10)textNO
B11Expression=COUNTIF($F$3:$AF$3,B11)textNO
B12Expression=COUNTIF($F$3:$AF$3,B12)textNO
B13Expression=COUNTIF($F$3:$AF$3,B13)textNO
B14Expression=COUNTIF($F$3:$AF$3,B14)textNO
B15Expression=COUNTIF($F$3:$AF$3,B15)textNO
B16Expression=COUNTIF($F$3:$AF$3,B16)textNO
B17Expression=COUNTIF($F$3:$AF$3,B17)textNO
B18Expression=COUNTIF($F$3:$AF$3,B18)textNO
B19Expression=COUNTIF($F$3:$AF$3,B19)textNO
B20Expression=COUNTIF($F$3:$AF$3,B20)textYES
B21Expression=COUNTIF($F$3:$AF$3,B21)textNO
B22Expression=COUNTIF($F$3:$AF$3,B22)textNO
B23Expression=COUNTIF($F$3:$AF$3,B23)textNO
B24Expression=COUNTIF($F$3:$AF$3,B24)textNO
B25Expression=COUNTIF($F$3:$AF$3,B25)textNO
B26Expression=COUNTIF($F$3:$AF$3,B26)textNO
B27Expression=COUNTIF($F$3:$AF$3,B27)textNO
B28Expression=COUNTIF($F$3:$AF$3,B28)textNO
B29Expression=COUNTIF($F$3:$AF$3,B29)textNO
B30Expression=COUNTIF($F$3:$AF$3,B30)textNO
B31Expression=COUNTIF($F$3:$AF$3,B31)textNO
B32Expression=COUNTIF($F$3:$AF$3,B32)textNO
B33Expression=COUNTIF($F$3:$AF$3,B33)textNO
B34Expression=COUNTIF($F$3:$AF$3,B34)textNO
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi

Please check whether this helps
I hope my understanding is clear

DX Codes are in column A
vlookup of Source

Three checks are being done
1. Presence in header row
2. Whether the individual entries in column A are present in exclusion list of the entries in column A (wild card match also included)
3. Not exactly a check- against a particular entry in column A, how many of the other entries are in the exclusion list
Col D highlights those exclusions against entries in Col A

Book12.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
1DX CODES ON YOUR CLAIMCheck 1 HeadingsCheck 2 In exclusionsWhich specific exclusionCheck 3 No of DX codes from the balance which are being duplicatedList of exclusions under the DX code in col A
2M81.010 0M80.*M89.0
3G89.410 0F45.41G43.*G44.*G50.1G54.6H57.1H92.0K08.8K14.6M25.5*M54.*M79.1*M79.6*N23N64.4N94.81*R07.*R10.*R30.9R51.9R52T82.84T83.84T84.84T85.84
4R53.8110 0F33F43.0O26.8*
5Z79.89110 0F1*O99.32*
6m48.06100 0 
7M25.56111M25.5*0M20.*M21.*M26.6*M65.2*M71.4*M75.3*M79.6*R26.*
8m25.56211M25.5*0M20.*M21.*M26.6*M65.2*M71.4*M75.3*M79.6*R26.*
9m25.53201M25.5*0 
10m54.1211M54.*0H45.41M47.2*M50.1*M51.1*M79.2*
11m54.1611M54.*0F45.41M47.2*M50.1M51.1*M79.2*
12m54.5911M54.*0F45.41M51.2*M54.4*S39.012
13
141 indicates duplicates, 0 implies no duplicate
Sheet4
Cell Formulas
RangeFormula
B2:B12B2=IF(ISNUMBER(MATCH(A2,Source!$E$2:$AE$2,0)),1,0)
C2:C12C2=SUM(IF(ISNUMBER(MATCH($G$2:$AE$12,TOROW(A2),0)),1,0))
D2:D12D2=FILTER(TOROW($G$2:$AE$12),TOROW(IF(ISNUMBER(MATCH($G$2:$AE$12,A2,0)),1,0))<>0,"")
E2E2=SUM(IF(ISNUMBER(MATCH(G2:AE2,D2:D12,0)),1,0))*IF(G2="",0,1)
E3E3=SUM(IF(ISNUMBER(MATCH(G3:AE3,D13:D13,0)),1,0))*IF(G3="",0,1)
E4E4=SUM(IF(ISNUMBER(MATCH(G4:AE4,D13:D14,0)),1,0))*IF(G4="",0,1)
E5E5=SUM(IF(ISNUMBER(MATCH(G5:AE5,D13:D15,0)),1,0))*IF(G5="",0,1)
E6E6=SUM(IF(ISNUMBER(MATCH(G6:AE6,D13:D16,0)),1,0))*IF(G6="",0,1)
E7E7=SUM(IF(ISNUMBER(MATCH(G7:AE7,D13:D17,0)),1,0))*IF(G7="",0,1)
E8E8=SUM(IF(ISNUMBER(MATCH(G8:AE8,D13:D18,0)),1,0))*IF(G8="",0,1)
E9E9=SUM(IF(ISNUMBER(MATCH(G9:AE9,D13:D19,0)),1,0))*IF(G9="",0,1)
E10E10=SUM(IF(ISNUMBER(MATCH(G10:AE10,D13:D20,0)),1,0))*IF(G10="",0,1)
E11E11=SUM(IF(ISNUMBER(MATCH(G11:AE11,D13:D21,0)),1,0))*IF(G11="",0,1)
E12E12=SUM(IF(ISNUMBER(MATCH(G12:AE12,D13:D22,0)),1,0))*IF(G12="",0,1)
G2:H2,G12:J12,G10:K11,G7:N8,G6,G9,G5:H5,G4:I4,G3:AE3G2=LET(a,TOROW(XLOOKUP(A2,Source!$E$2:$AE$2,Source!$E$3:$AE$34,0)),FILTER(a,a<>0,""))
Dynamic array formulas.
 
Upvote 0
Hi

Please check whether this helps
I hope my understanding is clear

DX Codes are in column A
vlookup of Source

Three checks are being done
1. Presence in header row
2. Whether the individual entries in column A are present in exclusion list of the entries in column A (wild card match also included)
3. Not exactly a check- against a particular entry in column A, how many of the other entries are in the exclusion list
Col D highlights those exclusions against entries in Col A

Book12.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
1DX CODES ON YOUR CLAIMCheck 1 HeadingsCheck 2 In exclusionsWhich specific exclusionCheck 3 No of DX codes from the balance which are being duplicatedList of exclusions under the DX code in col A
2M81.010 0M80.*M89.0
3G89.410 0F45.41G43.*G44.*G50.1G54.6H57.1H92.0K08.8K14.6M25.5*M54.*M79.1*M79.6*N23N64.4N94.81*R07.*R10.*R30.9R51.9R52T82.84T83.84T84.84T85.84
4R53.8110 0F33F43.0O26.8*
5Z79.89110 0F1*O99.32*
6m48.06100 0 
7M25.56111M25.5*0M20.*M21.*M26.6*M65.2*M71.4*M75.3*M79.6*R26.*
8m25.56211M25.5*0M20.*M21.*M26.6*M65.2*M71.4*M75.3*M79.6*R26.*
9m25.53201M25.5*0 
10m54.1211M54.*0H45.41M47.2*M50.1*M51.1*M79.2*
11m54.1611M54.*0F45.41M47.2*M50.1M51.1*M79.2*
12m54.5911M54.*0F45.41M51.2*M54.4*S39.012
13
141 indicates duplicates, 0 implies no duplicate
Sheet4
Cell Formulas
RangeFormula
B2:B12B2=IF(ISNUMBER(MATCH(A2,Source!$E$2:$AE$2,0)),1,0)
C2:C12C2=SUM(IF(ISNUMBER(MATCH($G$2:$AE$12,TOROW(A2),0)),1,0))
D2:D12D2=FILTER(TOROW($G$2:$AE$12),TOROW(IF(ISNUMBER(MATCH($G$2:$AE$12,A2,0)),1,0))<>0,"")
E2E2=SUM(IF(ISNUMBER(MATCH(G2:AE2,D2:D12,0)),1,0))*IF(G2="",0,1)
E3E3=SUM(IF(ISNUMBER(MATCH(G3:AE3,D13:D13,0)),1,0))*IF(G3="",0,1)
E4E4=SUM(IF(ISNUMBER(MATCH(G4:AE4,D13:D14,0)),1,0))*IF(G4="",0,1)
E5E5=SUM(IF(ISNUMBER(MATCH(G5:AE5,D13:D15,0)),1,0))*IF(G5="",0,1)
E6E6=SUM(IF(ISNUMBER(MATCH(G6:AE6,D13:D16,0)),1,0))*IF(G6="",0,1)
E7E7=SUM(IF(ISNUMBER(MATCH(G7:AE7,D13:D17,0)),1,0))*IF(G7="",0,1)
E8E8=SUM(IF(ISNUMBER(MATCH(G8:AE8,D13:D18,0)),1,0))*IF(G8="",0,1)
E9E9=SUM(IF(ISNUMBER(MATCH(G9:AE9,D13:D19,0)),1,0))*IF(G9="",0,1)
E10E10=SUM(IF(ISNUMBER(MATCH(G10:AE10,D13:D20,0)),1,0))*IF(G10="",0,1)
E11E11=SUM(IF(ISNUMBER(MATCH(G11:AE11,D13:D21,0)),1,0))*IF(G11="",0,1)
E12E12=SUM(IF(ISNUMBER(MATCH(G12:AE12,D13:D22,0)),1,0))*IF(G12="",0,1)
G2:H2,G12:J12,G10:K11,G7:N8,G6,G9,G5:H5,G4:I4,G3:AE3G2=LET(a,TOROW(XLOOKUP(A2,Source!$E$2:$AE$2,Source!$E$3:$AE$34,0)),FILTER(a,a<>0,""))
Dynamic array formulas.
Hi,

Thank you for your response. I think this is more or less what I've managed to do , but I'm having trouble integrating this into my excel program because of an error with the source in a few of the formulas. usually I either get an error message for a circular formula argument, or Excel crashes completely. Like I said I'm not familiar with Excel or XL2BB, so if there's something I'm meant to be doing to paste the mockup you've made into my native excel sheet please let me know.

If I'm understanding correctly, Column D will be what indicates which codes to remove (i.e. remove M25.562 in order to get C7=0, and remove M54.12, M54.16, and M54.59 to get C10=0). Is there a way to do this with conditional formatting to highlight the codes that need to be deleted? Or does the presence of the wildcards make this impossible?

Thanks.
 
Upvote 0
Hi

The first two checks flag cases where an exclusion can get highlighted
Please do a conditional formatting on col A depending on these two columns (col B and C)

Cases like cell A9- m25.532 escape the first check but get highlighted in the second check

Yes, Column D indicates which is the entry in the column G to column AE section is getting highlighted as an exclusion against the entry in column A

For example, A7 is M25.561---and an exclusion is getting highlighted in C7
D7 tells which particular entry in from col G to col AE is causing that highlight in C7 to happen, which is an entry M25.5*

Col E tells how many exclusions from are there in the DX list (col A)
For example, E3=2, implying that two of the exclusions given in col G to AE are there amongst the other entries in col A
These are M25.5* and M54.* as can be seen in col D

Please do share your feedback whether this helps

Book12.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
1DX CODES ON YOUR CLAIMCheck 1 HeadingsCheck 2 In exclusionsWhich specific exclusionCheck 3 No of DX codes from the balance which are being duplicatedList of exclusions under the DX code in col A
2M81.010 0M80.*M89.0
3G89.410 2F45.41G43.*G44.*G50.1G54.6H57.1H92.0K08.8K14.6M25.5*M54.*M79.1*M79.6*N23N64.4N94.81*R07.*R10.*R30.9R51.9R52T82.84T83.84T84.84T85.84
4R53.8110 0F33F43.0O26.8*
5Z79.89110 0F1*O99.32*
6m48.06100 0 
7M25.56111M25.5*0M20.*M21.*M26.6*M65.2*M71.4*M75.3*M79.6*R26.*
8m25.56211M25.5*0M20.*M21.*M26.6*M65.2*M71.4*M75.3*M79.6*R26.*
9m25.53201M25.5*0 
10m54.1211M54.*0H45.41M47.2*M50.1*M51.1*M79.2*
11m54.1611M54.*0F45.41M47.2*M50.1M51.1*M79.2*
12m54.5911M54.*0F45.41M51.2*M54.4*S39.012
13
141 indicates duplicates, 0 implies no duplicate
Sheet4
Cell Formulas
RangeFormula
B2:B12B2=IF(ISNUMBER(MATCH(A2,Source!$E$2:$AE$2,0)),1,0)
C2:C12C2=SUM(IF(ISNUMBER(MATCH($G$2:$AE$12,TOROW(A2),0)),1,0))
D2:D12D2=FILTER(TOROW($G$2:$AE$12),TOROW(IF(ISNUMBER(MATCH($G$2:$AE$12,A2,0)),1,0))<>0,"")
E2:E12E2=SUM(IF(ISNUMBER(MATCH(G2:AE2,D2:D12,0)),1,0))*IF(G2="",0,1)
G2:H2,G12:J12,G10:K11,G7:N8,G6,G9,G5:H5,G4:I4,G3:AE3G2=LET(a,TOROW(XLOOKUP(A2,Source!$E$2:$AE$2,Source!$E$3:$AE$34,0)),FILTER(a,a<>0,""))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

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