问题
I have the following example data set in excel.
Currently, for reference, John,Smith is in A4 and Smith Johnson is in B4.
Column 1 = Names of Members Column 2 = Attended (list of members that attended a meeting).
Applied to column 1, I would like to add a function that turns GREEN any members that are in column 2 (attended) that are also in column 1.
Like so:
The solution used in the end was to use this formula, which does the trick:
=SUMPRODUCT(--(MID($A4&" "&$A4,FIND(",",$A4)+2,FIND(",",$A4&" "&$A4,FIND(",",$A4)+2)-FIND(",",$A4)-2)=$B$4:$B$19))
A further difficulty however is that a) some usernames pasted into column 2 have numbers prefixing them. e.g. 22 John Smith or 22 Smith John
b)and that the order of the format [firstname lastname] or [lastname firstname] varies. Currently the formula only works if the column 2 names are in the format: [firstname lastname]
What I've tried: I have used the flash fill tool to remove digits and then paste the results into column 2, but was wondering if there was an amendment I could use to adapt this formula to be more of an all-in-one solution to do the following:
a) Match the columns on the basis of the names (regardless of the order - e.g. First name last name or last name first name AND b) remove the prefixing digit or any digits present as part of the formula (to essentially ignore them)
来源:https://stackoverflow.com/questions/65825530/adapting-existing-excel-function-to-find-a-match-in-a-different-column-and-remov