Questions tagged [regex]

regex stands for "regular expressions". They are used to define a string search pattern that could be used in some web applications like Google editors to do input validation, search and replace among other similar tasks.

Filter by
Sorted by
Tagged with
0 votes
1 answer
33 views

ArrayFormula and Categorize Data in Google Sheets using Regular Expressions

I'm following this post to categorize data in Google Sheets using regular expressions. The person who wrote the answer was able to get the formula to automatically write down the category in column D. ...
1 vote
3 answers
183 views

Create a regex for Google Analytics, to tack a specific US phone number that can be in multiple formats

I want to write a regular expression to tack a number in Google Analytics for a specific US phone number that supports the following formats: ###-###-#### (###) ###-#### ### ### #### ###.###.#### ...
1 vote
1 answer
1k views

Arrayformula for running MAX of separate column

I'm trying to use ARRAYFORMULA in Google Sheets to get the max figures from a separate column only up to the row being calculated each time but can't for the life of me figure out how. It sounds more ...
0 votes
2 answers
51 views

How to work over rows from all other sheets in Google Sheets?

I have a 'summary' sheet and 12 other sheets named 'Jan20', 'Feb20', etc. In the summary sheet I have this formula (to calculate Uber costs): =FILTER('Jan20'!F2:F, REGEXMATCH('Jan20'!D2:D, "UBER")) ...
0 votes
2 answers
532 views

How to export CSV without commas in unpopulated cells?

I have a form converter which simply rearranges columns. I use a script to paste Values only into another sheet for export and uploading onto another website. However, when I go to export, it seems ...
0 votes
1 answer
101 views

Conditional formatting with multiple names in list

Col A2:C15 contain a list of names. I need to enter those names in various combinations into one of 15 other cells on formatted like: H3 = John, Steve, Bob, Dan Is there a way to use conditional ...
1 vote
1 answer
19 views

How to exclude all terms except one word in title when searching YouTube or Google?

That is, how to find one-word-titled webpages in Google search results or in YouTube search results. For example, when searching YouTube for the word ‘verb’, I want only videos with the word ‘verb’ as ...
0 votes
1 answer
22 views

How to extract desired text from a cell

As you can see below I have these data in single cell I want only car nos as my result
1 vote
1 answer
26 views

How to create an average value for every cell which contains a certain phrase?

I need to find the average value of cells containing a certain set of initials to create a scoreboard. The value of the cell being the score and the brackets containing the initials of the score ...
0 votes
1 answer
31 views

Sort sentences based on formatting

I have a list of sentences in Google Sheets, each word in a different column. There is a stupid man. How we came here we don't know anything about. Finally, it has come to this. Shaking my head. How ...
1 vote
1 answer
21 views

Issue with finding the averages of multiple rows at once

I am currently tasked with hundreds of rows of data for a project. I need to take the average of each row, but there are way too many rows for me to do by each individual row. Is there any way to take ...
0 votes
2 answers
1k views

How do I replace a paragraph break (i.e. Enter) with a Shift+Enter character in Google Docs?

That is, what regexes do I place in these two boxes I have read Syntax for Unicode characters in regexes in Google Sheets? to no avail. I found from one answer that [\n] matches paragraph mark. Now ...
0 votes
0 answers
476 views

Extract data from web with Google script

I'm trying to use the function below (source) to avoid using importxml in Google Sheets: function importRegex(url, regex_string) { var html, content = ''; var response = UrlFetchApp.fetch(url); ...
0 votes
1 answer
34 views

Google Sheet Regex URL Replace

Looking for regex or another solution to update all the URLs without HTTPS at the start of the domain; for example, domain.com to > https://domain.com. Please, note I have multiple domains in the ...
0 votes
2 answers
101 views

Cell reference for contains value in Google Sheet

Looking for help referencing another spreadsheet, where I want to lookup several values in cell A2, to see if the value is contained in the cell (as there are variations), then setup an else clause at ...
0 votes
1 answer
37 views

Remove all Array_Constrain(ArrayForumla(*),1,1) formulas when importing from Excel to Google Sheets using RegEx

My first question here. I have an Excel Spreadsheet, where I have not used CSE, which I import into Google Sheets. Upon importing, some 40k+ cells have =Array_Constrain(ArrayFormula(*),1,1) in them. ...
1 vote
2 answers
2k views

Using Google Sheets to bulk collect the number of Google Search results for given keywords

I would like to create a Google Sheets that will allow me to paste in a list of 25 or so keywords in column A and would then return the number of search results for each of those terms in column B. ...
0 votes
2 answers
137 views

Extracting 2nd occurrence of a number in brackets / Google Sheet/Excel

I currently have cell that has the following output from my Google Sheet: Share Price vs. Fair ValueBelow Fair Value: AAPL ($126.85) is trading above our estimate of fairvalue ($118.02)Significantly ...
0 votes
2 answers
104 views

IF and IFS not working properly

I am trying to locate data present in different sheets. I have tried using IF and IFS. Below are the formulas I have used. For IF, I get NOT IN USE even when I know there should be one of the sheets ...
0 votes
2 answers
386 views

IF Function with too many arguments

I want to apply this formula =IF(A2= "", "", IF(REGEXMATCH(A2, "Brand"), "Brand", if(regexmatch(A2, "Loans"), "Loans" , if(regexmatch(A2, "Cards"), "Credit Cards", if(A2, "Generic"),"Generic",...
0 votes
2 answers
222 views

How to filter after parsing CSV values contained in Google Sheets cells

I would like to be able to match all cells in column A (titles) that have one of the comma-separated values in column E (Key Search Terms). This will involve at least two steps. 1) Parse each of the ...
0 votes
1 answer
66 views

If cell y contains any word from range x:x, mark cell y green

In Google Sheets, I have three columns (with different lengths!) Column1 contains firm names (50) Column2 containts firm names (100) I would like to mark a cell in Column1 green (or with a number in ...
0 votes
2 answers
82 views

In Google Sheets, analyze cell content, and if certain values are present, return a response in the next column

In the below example, I want to analyze each cell in column A, and if the cell's contents match certain parameters, return a value in column B accordingly. So if the value in a col A cell = apple, ...
1 vote
2 answers
48 views

Spreadsheet formula to calculate most common items in ordered items lists

I am searching for a correct google spreadsheet formula to go through the list of ordered items and summarise the resulting winning items. Like is you have an Oscar ceremony and you get votes from ...
0 votes
1 answer
58 views

How to assign country based off list of either provinces or states?

I have a list of names and locations. Most of the locations include the name of the province or state. Some only include country names, some include state abbreviations. I also have a list of ...
1 vote
2 answers
426 views

RegexReplace produces an error

I have two sheets of data as per below: ╔═══════════╦══════╦══════════════╗ ║ SheetName ║ Cell ║ CellValue ║ ╠═══════════╬══════╬══════════════╣ ║ Sheet1 ║ B1 ║ ='sheet2'!A2 ║ ║ Sheet2 ║ ...
0 votes
1 answer
121 views

RegEx on Google Forms: How to make Case Insensitive work?

I have been wondering, how to use case insensitive regular expression for a response validation in a form where there are different possible answers? I have tried: (name1|name2|name3) and it really ...
0 votes
1 answer
1k views

How to TEXTJOIN in Google Sheets

I have ten columns in my rows which contain 5 sets of first name/last name. I want to combine each of these names in a final column using TEXTJOIN (or whatever function is appropriate if I'm missing ...
0 votes
1 answer
745 views

How to ignore certain strings when creating unique list of words in Google Sheets?

In Google Sheets, I am using the formula to create a unique list of words: =unique(transpose(split(ArrayFormula(concatenate(B2:E"+")),"+"))) But I want to filter out certain strings. My unique list ...
0 votes
2 answers
4k views

Google Sheets for if contains "*"

I have found the the regexmatch solution for substring: Google Sheets formula for "if contains" However, why for "*" is not working? I'm trying to make a condition if the name ...
4 votes
1 answer
142 views

Rearrange Name Format in Google Sheets using one formula only

Is there a simple way to do this using only one arrayed formula? Here are the names listed in the above image: NAME dela Cruz, Antonio Karl Jr. Woods, Oliver Hasegawa, Ken Sr. Sta. Maria, ...
1 vote
3 answers
1k views

Checkbox to activate a column in QUERY

Is there a way to activate/deactivate a column in QUERY function? I have a query to query and selection of several columns Select Col1,Col31,Col32,Col33,Col25,Col26, and want to have a checkbox for ...
0 votes
0 answers
36 views

Issue using Trim and RegExReplace to grab hashtagged terms from text entries

I am new to the more complicated functions of Excel and Google Sheets. I am trying to extract hashtagged words from my journal entries to get the gist of what those entries are about. I had pretty ...
0 votes
1 answer
18 views

Flexible formula to match strings in 1 row to run a formula in matching columns in another row

I have a row where all strings have the identical format (XX-#####-##) in which Xs are 2 upper case alphabet letters and the #s are integers. Short example, see the doc for more KC-30000-00 | KC-30000-...
0 votes
1 answer
197 views

Avoid keeping adding numbers in headings in Google Docs

I am using a modified version taken from this useful answer to get numbers in my Google Docs Header 2: function myFunction() { var pars = DocumentApp.getActiveDocument().getParagraphs(); var ...
0 votes
3 answers
3k views

Can Weekday value be shown in natural (Su, Mo, Tu..) format in Array Formula?

For Google sheet with the following data in A2:B4 06/29/2019 1:25 PM 1 06/30/2019 1:32 PM 1 07/01/2019 1:40 PM 1 The output will show Monday 1 1 Saturday 1 1 Sunday 1 1 Can this be ...
0 votes
1 answer
26 views

how to use regextract to find occurences of a number when it ends with a 2 after decimel point

my number set looks like this example -360.132, 125, 140.0152, -400.13, i would like to be able to have an if statement for the numbers that end with a "2" after the decimel point. So i want ...
0 votes
1 answer
126 views

Google Sheets Replace REGEXMATCH with REGEXEXTRACT

I am working with a Google Sheet where column A contains a set of values. Every value contains the following string "SAME_WORD LETTER", where LETTER is one of the alphabet letters, like &...
76 votes
9 answers
134k views

Is there a way to search in Google using regular expressions (regex)?

It would be very useful if Google provided a regular expression search. Is there a way to do this? (OBS: I am not talking about false regular expressions like site:, filetype:, AND, OR or "Text". I ...
0 votes
0 answers
348 views

Can I use advanced regex pattern search in Google search?

I tried to find results that match pattern such as Apple\s*,\s*[a-zA-Z]+ but it only returned unnecessary data like regex or etc.. I needed only results like such as "Apple, Samsung". Maybe ...
0 votes
2 answers
6k views

In Google Sheets I need to find a string and return true/false, or even a count into a cell so I can perform an action

In my example i have a column with Names of signs we product in our sighshop and I need to be able to isolate similar named signs So say I need to return a a value if the cell is Bud Light and only ...
0 votes
1 answer
21 views

REGEXMATCH for single cell min/max character criteria?

I'm very new to the regex scene so forgive my level of intelligence! I want a single cell to be 5 or 7 characters long via data validation and an error message for a false return. I've come up with ...
-1 votes
1 answer
532 views

How do I use non capturing groups in google sheets?

This is what I intend to do. But a similar one doesn't work. As with any problem I post, I still can't solve it after more than two hours of trying. :-( https://github.com/google/re2/wiki/Syntax
0 votes
1 answer
653 views

Problem with invalid regular expression missing / (slash)

I have a spreadsheet. I want to send emails from the Apps Script. The logic to send email as follows. Only send 1 email to each unique value in Column A (Co Name) the content of the email will include ...
2 votes
2 answers
173 views

Formula to count the number of different letters in a word

In sheets, suppose cell A1 contains the word CABBAGE. I want to put a formula into, say, cell B1 that will count the number of different letters. So the output should be 5, because there are 5 ...
0 votes
2 answers
168 views

Can't format hardkey date data as a date in Google sheets?

I've got some date data in a Google drive sheet which is imported from a CSV. The date data is formatted as either dd/mm/yy or dd.mm.yy as hard key data (eg. not formatted as a date) I got to format &...
0 votes
1 answer
156 views

REGEX in Google Sheets with Filter

I'm trying to mix regex with a filter in Google Sheets. What I have at the moment is =filter(AD:AD,X:X=X2,right(Z:Z,1)={1,2,3,4,5,6,7,8,9}) The regular expression is that the final character in ...
146 votes
8 answers
701k views

Google Sheets formula for "if contains"

I'm trying to figure out how to identify IF a list of items in one cell contains a value or string. EXAMPLE Cell A1 contains sites, sheets, docs, slides. I want cell B1 to display a 1 'if' cell ...
-1 votes
1 answer
59 views

How should I go about populating a Google Sheet with website metadata?

I am creating a table in Google Sheets that will allow me to aggregate various metrics that are relevant for a web-based company. The website has about 3000 pages, most of which are 1000+ word blogs. ...
0 votes
1 answer
113 views

Count if contains yes using array formula for Google Form entries

I want to count every yes per submission of each Google Form, so the row. Some of the responses have comments after the yes and it won't count those. This is the formula I am using: ={"Score"...