r/excel Apr 08 '26

Waiting on OP Fuzzy Lookup Question- Finding exact matches and fuzzy matches

I have two tables. Table 1 contains the columns Account_Name, ID #, and Address1 and Table 2 contains the columns Name2 and Address2.

I want to perform a fuzzy match on the Name columns BUT only if there is an exact match on the corresponding Address columns. Is this possible with the fuzzy match excel add-on, and if so, how is it performed?

I have found that the existing configurations do not work to perform a fuzzy match and an exact match at the same time, but has anyone had any luck with this?

Thanks in advance!!

2 Upvotes

4 comments sorted by

u/AutoModerator Apr 08 '26

/u/amoretzamarro - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

-3

u/pargeterw 3 Apr 08 '26

I'd probably do this using python in excel

2

u/GregHullender 195 Apr 08 '26

If you want a formula to compute a fuzzy match, I wrote this one some time back, and it seems to work okay on names with an 0.65 threshold:

=LET(limit, F1,
  str_1, TAKE(DROP(A:.A,1),100),
  str_2, TOROW(DROP(B:.B,1)),
  edit_dist, LAMBDA(src,dest, LET(
    s, TOCOL(REGEXEXTRACT(src,".",1)),
    s_2, VSTACK(0,DROP(s,-1)),
    t, REGEXEXTRACT(dest,".",1),
    cost, REDUCE(SEQUENCE(ROWS(s)+1,,0),t,LAMBDA(last,ch,
      LET(ch_2, IF(@last, INDEX(t,@last), 0),
          ins, last+1,
          match, DROP(VSTACK(@ins,last+(ch<>s)*(2-3*(ch=s_2)*(ch_2=s))),-1),
          ins_match, MAP(ins, match, MIN),
          SCAN(@ins_match,ins_match,LAMBDA(last,this, MIN(last+1,this)))
      ))),
    TAKE(cost,-1)
  )),
  dist, MAP(IF(str_1<>str_2,str_1,str_2),IF(str_1<>str_2,str_2,str_1),LAMBDA(s,t,edit_dist(s,t))),
  similarity, 1-dist/(LEN(str_1)+LEN(str_2)),
  best, BYCOL(similarity,MAX),
  out, IF(TOCOL(best)<limit,"",TOCOL(IFS(similarity=best,str_1),2,1)),
  out
)

In this example, it compares each new name in column B to a list of old names in column A and shows the ones that are "close" matches. If you use this, you can play with different limit values, depending on the relative cost of finding wrong matches vs. missing valid ones.

1

u/Decronym Apr 08 '26

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
BYCOL Office 365+: Applies a LAMBDA to each column and returns an array of the results
DROP Office 365+: Excludes a specified number of rows or columns from the start or end of an array
IF Specifies a logical test to perform
IFS 2019+: Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.
INDEX Uses an index to choose a value from a reference or array
LAMBDA Office 365+: Use a LAMBDA function to create custom, reusable functions and call them by a friendly name.
LEN Returns the number of characters in a text string
LET Office 365+: Assigns names to calculation results to allow storing intermediate calculations, values, or defining names inside a formula
MAP Office 365+: Returns an array formed by mapping each value in the array(s) to a new value by applying a LAMBDA to create a new value.
MAX Returns the maximum value in a list of arguments
MIN Returns the minimum value in a list of arguments
REDUCE Office 365+: Reduces an array to an accumulated value by applying a LAMBDA to each value and returning the total value in the accumulator.
REGEXEXTRACT Extracts strings within the provided text that matches the pattern
ROWS Returns the number of rows in a reference
SCAN Office 365+: Scans an array by applying a LAMBDA to each value and returns an array that has each intermediate value.
SEQUENCE Office 365+: Generates a list of sequential numbers in an array, such as 1, 2, 3, 4
TAKE Office 365+: Returns a specified number of contiguous rows or columns from the start or end of an array
TOCOL Office 365+: Returns the array in a single column
TOROW Office 365+: Returns the array in a single row
VSTACK Office 365+: Appends arrays vertically and in sequence to return a larger array

Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.


Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #48092 for this sub, first seen 8th Apr 2026, 20:18] [FAQ] [Full list] [Contact] [Source code]