Extra commas in Zapier Formatter > Utilities > line item to text - zapier

I am trying to use either the line item to text formatter or split by comma formatter in Zapier.
Normally, this works fine, but sometimes an input has a comma within the text, which leads to extra outputs (line items).
For example--
This is what I would like to happen:
Input: Bob Smith, Jr., Firefighter
Output:
1: Bob Smith, Jr.
2: Firefighter
This is what I am getting:
Input: Bob Smith, Jr., Firefighter
Output:
1: Bob Smith
2: Jr.
3: Firefighter

This won't be possible - the splitting function has no way of knowing that Smith, Jr. is different from Smith, Brown.
I'm not sure how much control you have over your input, but it's common in this case to group strings with quotes:
"Bob Smith, Jr.", "Firefighter"
Then you can split out each pair of matched " (not with the "split" tool, but with some code) and know that you're always getting the right parts.

Related

Remove Repeated "Inverted" Rows

Repeated rows maybe easy to filter but is there to remove repeated INVERTED rows from different columns in google sheets. Maybe it is easy but I've not had much luck so far with "unique" or "filter". The attached image should show what I'm looking to accomplish. Unique alone doesn't work because the second column (I)includes names from (H). So sheets looks at both columns as unique and returns them all. But this is like wanting to remove repeated first and last names, where the names might be inverted.
On the right is the result I'd like to achieve. Leaving only ONE match that would include the numeric values.
Appreciate any feedback. Thanks. 🙏
Get row number MATCH Name1 in Name2 Col. Get row number MATCH Name2 in Name1 Col. See if they are equal and whether the first MATCH is greater than or equal to the current row number.
=FILTER(A2:B7,IFNA(XMATCH(A2:A7,B2:B7)>=ROW(A2:A7)*(XMATCH(A2:A7,B2:B7)=XMATCH(B2:B7,A2:A7)),1))
Name1
Name2
Results
John
Doe
John
Doe
Dan
Jove
Dan
Jove
Doe
John
Jack
Tyler
Jack
Tyler
Jove
Dan
Doe
John
Another method would be to SORT BYROW and UNIQUE

Comparing 2 columns for certain words

=COUNTIF(B4:B, "" & D4:D & "")
So column B4:B will have something like this
Joe Smith, STIM
and column D4:D would have something like this
Joe Smith 10/19/1999 AC
I am trying to make a True False statment in Col G that if column B has Joe Smith and Column D has Joe smith it will say yes or no. This will be a list of names that always change dynamically so one day B4 might be Joe Smith but the next day it could be Jan Doe. Column D will be a list of names in alpha order that changes all the time as well.
I was able to replicate what you need with the example provided by using:
=ArrayFormula(IF(D:D="",,REGEXMATCH(LOWER(D:D),FILTER(LOWER(I:I),I:I<>"")&"\b")))
You can see the results in my testing spreadsheet here.
At the moment I have limited the range from column I but you can just change it so it takes the whole column.
Just one little detail is that with this function you can only have 1 name in each row in the list of names.

Cross reference in Google Sheets (2 sheets with varying length columns and potential duplicates)

First off, many thanks in advance! This is my first post. I am brand new to google sheets as well.
My data is the following. One sheet contains a column of last names only. The last names columns does include duplicate last names. My main sheet contains a column of first and last names which is about 3x as long as the list of last names only.
I would like to generate a boolean column for pivoting purposes which cross references the last name list with the full names. If any of the last names are partially matched to a full name, then the boolean is a 1 or TRUE.
Cross Reference: Doe & Mann
Jim Smith
0
Jane Doe
1
John Rich
0
Joe Bills
0
Brian The Mann
1
Bill Downs
0
=ArrayFormula(REGEXMATCH(A1:A11, TEXTJOIN("|", TRUE, C1:C11)))
Paste this in the column where you want TRUE/FALSE. Replace A1:A11 with your full names list, C1:C11 with your cross-reference.
If you would like empty spaces, or customize the response, use:
=ArrayFormula(IF(REGEXMATCH(A1:A11, TEXTJOIN("|", TRUE, C1:C11)), "TRUE TEXT", "FALSE TEXT"))
try:
=INDEX(IF(A1:A="";;N(REGEXMATCH(A1:A; TEXTJOIN("|"; 1; E:E)))))

Is there code that can force a user to enter a particular format into a cell?

I have a Google Spreadsheet.
Google Spreadsheet
When users enter a name into any cell of column A of the sheet named "Unit Standards" I want them to enter that name in a particular format. That is, with the surname first in uppercase then a comma, then the first name in title case then if they are known by a different name that name to be title case in brackets e.g.
BUSH, George
TRUMP, Donald
CLINTON, William (Bill)
CARTER, James (Jimmy)
SMITH-JONES, John
ZETA-JONES, Catherine (Kate)
Is there a way to force them to do that before they leave the cell or the sheet?
You could use a script. Still.
You can have the same results with a simple formula using Data Validation on column A.
This is the formula to put in cell A2 for the range A2:A555:
=REGEXMATCH(A2,"^[A-Z]+\b[',']\s[A-Z]{1}[a-z]+\b(\s([A-Z][a-z]+\b))?$")
Reading the regular expression:
^[A-Z]+\b[',']\s[A-Z]{1}[a-z]+\b(\s([A-Z][a-z]+\b))?$
^[A-Z]+\b: In the beginning have only 1 or more capital letters until the end of the word
[',']\s: Have a , followed by an empty space
[A-Z]{1}[a-z]+\b: Have only 1 capital letter and 1 or more small letters till the end of the word
(\s\([A-Z][a-z]+\b\))?$: All of the above could be followed ? by this string.
\s\(: An empty space and an opening parenthesis (
[A-Z][a-z]+\b: A word starting with just 1 capital followed by 1 or more small letters
\): A closing parenthesis
$: End of string

Split first name(s) from last name in Google Sheets

I wanted to separate the last name in a cell from any and all first/middle names.
EG:
"Greg Smith"
"Andy H K Anderson"
"Tony & Amanda Ferguson"
Becomes
Greg | Smith
Andy H K | Anderson
Tony & Amanda | Ferguson
Couldn't find an answer here or on any other site. but I did manage to write my own formula that I wanted to share in case others run into this same problem. And perhaps someone else could make a better version.
FIRST NAME(S):
=LEFT(A2,MINUS(LEN(A2),LEN(INDEX(SPLIT(A2," "),0,COUNTA(SPLIT(A2," "))))))
LAST NAME:
=INDEX(SPLIT(A2," "),0,COUNTA(SPLIT(A2," ")))
An alternative way (using a single array formula) would be to use regexextract
=Arrayformula(if(len(A2:A), regexextract(A2:A, "(.+)\s([^\s]+)$"),))
The first capturing group (.+) extracts
every character .+
before the last space \s (in a 'greedy' way),
the second capturing group ([^\s]+) extracts
everything after the last space [^\s]+
to the end of the string $.

Resources