Unfortunately the data I'm working with requires quotation marks, as it is entered into another system afterwards which requires it.
I'm trying to collect statistics, and need to count these entries. The only thing they have in common is they are wrapped in quotation marks.
I'm trying to use =COUNTIF($C3:$C, """) but it keeps changing it to =COUNTIF($C3:$C, "")"").
Is there a way to escape this so that i can count cells that contain a quotation mark (")?
Like Robin said, the most straightforward way to reference quotes is with the character code - for the double quote character it's CHAR(34). One possible solution to this uses QUERY(), like so:
=QUERY($C3:$C, "Select count(C) where C contains '" & CHAR(34) & "' label count(C) ''", 0)
You can omit the label count(C) '' at the end if you're okay with it displaying a header cell, but adding it on contains the entire result to a single cell.
Try this it seems to do what you want to do:
=COUNTIF(C3:C, "'*")
note the single quote mark.
Related
I have a google sheet with a list of names that I am trying to apply my existing formula to. There are some names that have parentheses with text within those parentheses as well as some names that are all captial letters. I want to remove the parentheses and the text within as well having only the first letter of each name capitalized written into a formula. My existing formula removes the parenthese, dashes and quotation marks which I want to keep it that way, but now I am just wantint to add onto that formula all together for what I stated above. I will also link my practice google sheet so you can see where I am applying the formula.
Formula: =ARRAYFORMULA(TRIM(REGEXREPLACE(C4:C411,"-|'|,|(|)|"""," ")))
Practice Formula Sheet
If the doc is not accessible here is photo of what it looks like
I was trying to use an older version of this formula i.e: =REGEXREPLACE(C4:C411,"([^()]*)","").
This does remove the parentheses with the text inside as well but thats it. I need to remove the parentheses as well as the text within those parentheses and the names that are all captial letters. I want to remove the parentheses and the text within as well having only the first letter of each name capitalized written into a formula.
can you try this:
=ARRAYFORMULA(PROPER(TRIM(REGEXREPLACE(REGEXREPLACE(A:A,"\(.*?\)",""),"[^\w\s]"," "))))
try:
=INDEX(TRIM(REGEXREPLACE(REGEXREPLACE(A25:A28,
"['-]", " "), "[^A-Za-z ]", )))
you can add PROPER, LOWER or UPPER if you need so:
=INDEX(PROPER(TRIM(REGEXREPLACE(REGEXREPLACE(A25:A28,
"['-]", " "), "[^A-Za-z ]", ))))
I have a data set wherein emails are populated. I would like to list all the surnames extracted in the emails per cell and will be all joined to a one single cell but I want to put a separator or delimeter to the emails obtaine per cell.
Here is the data set:
A
B
john.smith#gmail.com, jane.doe#gmail.com
UPDATE
john.smith#gmail.com
CLOSE
And here is the formula to extract
=ARRAYFORMULA(
PROPER(
REGEXEXTRACT(
A:A,
REGEXREPLACE(
A:A,
"(\w+)#","($1)#"
)
)
)
)
This initially yields the ff:
C
D
Smith
Doe
Smith
I would like to use JOIN() inside the ARRAYFORMULA() but it is not working as I seem to think it would since it outputs an error that it only accepts one row or one column of data. My initial understanding of ARRAYFORMULA() is that it iterates through the course of the data, so I thought it will JOIN() first, and then move on to the next element/row but I guess it doesn't work that way. I can use FLATTEN() but I want to have delimiters or separators in between the row elements. I need help in obtaining my intended final result which will look like this:
UPDATE:
Smith
Doe
CLOSE:
Smith
All are located in one cell, C1. UPDATE and CLOSE are from column B.
EDIT: I would like to clarify that the email entries in column A are dynamic and maybe more than two.
I think this will work:
=arrayformula(flatten(if(A2:A<>"",regexreplace(trim(split(B2:B&":"&char(9999)®exreplace(Proper(A2:A),"#[\w\.]+,\ ?|#.*",char(9999)&" "),char(9999))),".*\.",),)))
NOTES:
Proper(A2:A) changes the capitalisation.
The regexreplace "#[\w\.]+,\ ?|#.*" finds:
# symbol...
then any number of A-Z, a-z, 0-9, _ [using \w] or . [using \.]
then a comma
then 'optionally' a space \ [the optional bit is ?]
or [using |], the # symbol then an number of characters [using .*]
The result is replaced with a character that you won't expect to have in your text - char(9999) which is a pencil icon, and a trailing space (used later on when the flatten keeps a gap between lines). The purpose is to get all of the 'name.surname' and 'nameonly' values in front of any # symbol and separate them with char(9999).
Then infront of the regexreplace is B2:B&":"&char(9999)& which gets the value from column B, the : chanracter and char(9999).
The split() function then separates then into columns. Trim() is used to get rid of spaces in front of names that don't contain ..
The next regexreplace() function deletes anything before, and including . to keep surname or name without ..
The if(A2:A<>"" only process rows where there is a value in col A. The arrayformula() function is required to cascade the formula down the sheet.
I didn't output the results in a single cell, but it looks like you've sorted that with textjoin.
Here's my version of getting the results into a single cell.
=arrayformula(textjoin(char(10),1,if(A2:A<>"",REGEXREPLACE(B2:B&":"&char(10)®exreplace(Proper(A2:A),"#[\w\.]+,\ ?|#.*",char(10)),".*\.",),)))
Assuming that your A:A cells will always contain only contiguous email addresses separated by commas, you could place this in, say, C1 (being sure that both Columns C and D are otherwise empty beforehand):
=TRANSPOSE(FILTER({B:B,IFERROR(REGEXEXTRACT(SPLIT(PROPER(A:A),","),"([^\.]+)#"))},A:A<>""))
If this produces the desired result and you'd like to know how it works, report back. The first step, however, is to make sure it works as expected.
use:
=INDEX(REGEXREPLACE(TRIM(QUERY(FLATTEN(QUERY(TRANSPOSE({{B1; IF(B2:B="",,"×"&B2:B)},
PROPER(REGEXEXTRACT(A:A, REGEXREPLACE(A:A, "(\w+)#", "($1)#")))})
,,9^9)),,9^9)), " |×", CHAR(10)))
When I perform this function, it works:
=Query(CRM!1:1085,"Select B where D contains 'FirstName LastName' ",4)
When I perform this one, where B31 is where the text "FirstName LastName" is located in the sheet, the output is only ONE of the many results:
=Query(CRM!1:1085,"Select B where D contains '&B31&' ",4)
I want to be able to use the cell rather than write the quoted text in the formula. This is because I need to quickly replicate the formula for many different values. Also because it needs to be automated in case of changes in the source.
B31 is interpreted as literal string, when you use just 'B31'. You need to use double quotes along with single ones and concatenate:
'"&B31&"'
I am trying to do a query which pulls a date based on a name from a cell that contains many names separated by commas that was created by a Google form.
This using the wildcards will pull all the dates from any name that is in B except give an error when the name contains an apostrophe:
=QUERY("SOURCE", "select max(D) where (B like '%"&$A$7&"%') Label max(D) ''", 0)
Alternatively, often times B only has a single name so I can run the following query and pull the date I need if B only has a single name even with an apostrophe.
=QUERY("SOURCE", "select max(D) where (B like """&$A$7&""") Label max(D) ''", 0)
What I can't figure out is how to use the wildcard characters and escape the apostrophe at the same time.
Maybe filter() is easier to use in this situation? Assuming names are separated with a comma (and a space), try
=if(len(G4)*len(F6), max(filter(B3:B, regexmatch(A3:A, G6), regexmatch(C3:C, F6))),)
Change ranges to suit.
If that doesn't help, please share an example spreadsheet.
I am working with a google sheet that in one column can hold 1+ strings of numbers, and in another column, needs to read those numbers in and concat them with a link.
What I mean by this is and what works thus far: Column A - 324243324 || Column B - =concat("google.com/", Column A) = google.com/324243324
What I hope to get working: Column A - 324243324 5004938 || Column B - =concat("google.com/", Column A) = google.com/324243324 google.com/5004938
Is this possible? Thank you for your help!
You want to (a) split the input by spaces; (b) prepend each part by "google.com/"; and (c) join again, separated by spaces. This is achieved by
=join(" ", arrayformula("google.com/" & split(A1, " ")))
The & operator is equivalent to CONCAT but easier to type. arrayformula indicates that the operation is done on an array (the output of split).
However, these links will not be hyperlinked; joining makes them into plain text. To keep them functional, remove the last step, "join", so that each link appears in its own cell.