How can I use ArrayFormula within a formula containing Vlookup, Filter and RegexMatch - regex

I'm making a Google Spreadsheet which checks if a Value in Column A contains keywords out of a List in Column F. Problem is that I want to check if the value in A is exactly the same OR partly the same.
With a lot of help i've found over here I created this working formula:
=VLOOKUP(FILTER(ArrayFormula((LOWER(F:F)));REGEXMATCH(LOWER(A2);ArrayFormula((LOWER(F:F)))));ArrayFormula((LOWER(F:G)));1;FALSE)
Because I automatically import new lines of data I want to use ARRAYFORMULA. Unfortunately, I can't get it done.
This are my working formulas:
=VLOOKUP(FILTER(ArrayFormula((LOWER(F:F)));REGEXMATCH(LOWER(A2);ArrayFormula((LOWER(F:F)))));ArrayFormula((LOWER(F:F)));1;FALSE)
=VLOOKUP(FILTER(ArrayFormula((LOWER(F:F)));REGEXMATCH(LOWER(A3);ArrayFormula((LOWER(F:F)))));ArrayFormula((LOWER(F:F)));1;FALSE)
You can find my spreadsheet over here:
https://docs.google.com/spreadsheets/d/1aIdQ65SdeXW-4cTr8azQIiLNGcRCvTexGS_lFu8mECs/edit#gid=1308644379

=ARRAYFORMULA(PROPER(IFERROR(REGEXEXTRACT(LOWER(A2:A); LOWER(TEXTJOIN("|"; 1; F2:F))))))

Related

I want to turn this if formula into an array formula but cant seem to get it to auto populate down the rows

I want the driving distance between two address's and I am running a script that allows the following statement work.
This works but I have to drag the formula down when new rows are added from my mobile app into my sheet
=(IF(ISBLANK($AF2:$AF),"",DrivingMeters($E2:$E,$AF2:$AF)/1000))
This doesn't work
=ARRAYFORMULA(IF(ISBLANK($AF$2:$AF),"",DrivingMeters($E$2:$E,$AF$2:$AF)/1000))
I cant work out what I am doing wrong?
it could possible be you need to adjust your DrivingMeters custom formula to accept arrays. Please share the sheet or custom formula
try:
=ARRAYFORMULA(IF(AF2:AF="",, DrivingMeters(E2:E, AF2:AF)/1000))

Google Sheets Array formula for counting the number of values in each column

I'm trying to create an array formula to auto-populate the total count of values for each column as columns are added.
I've tried doing this using a combination of count and indirect, as well as tried my hand at query, but I can't seem to get it to show unique value counts for each column.
This is my first time attempting to use query, and at first it seemed possible from reading through the documentation on the query language, but I haven't been able to figure it out.
Here's the shared document: https://docs.google.com/spreadsheets/d/15VwsL7uTsORLqBDrnT3VdwAWlXLh-JgoJVbz7wkoMAo/edit?usp=sharing
I know I can do this by writing a custom function in apps script, but I'd like to use the built-in functions if I can for performance reasons (there is going to be a lot of data), and I want quick refresh rates.
try:
=ARRAYFORMULA(IF(B5:5="",,TRANSPOSE(MMULT(TRANSPOSE(N(B6:99<>"")), SIGN(ROW(B6:99))))))
In B3 try
=ArrayFormula(IF(LEN(B5:5), COUNTIF(IF(B6:21<>"", COLUMN(B6:21)), COLUMN(B6:21)),))

Extract column value using REGEXEXTRACT with ARRAYFORMULA

I have a column in Google Sheets with values like 1(current), 2(current), etc. I am getting these values from google form response.
I want to extract only the integer from cell value as 1,2,3.. so on.
I am able to use SPLIT(A2, "(current)") for cells. But this does not get applied for new values from form response.
I found that ARRAYFORLMULA can be used for applying a formula to new responses from forms, but somehow it isn't working. I tried them as mentioned below, but I am not sure if I am using it correctly.
=ArrayFormula(QUERY( SPLIT(E2:E,"(current)")))
=ArrayFormula(SPLIT(E2:E,"(current)"))
Can someone help with how to achieve above answer with REGEXEXTRACT?
try like this:
=ARRAYFORMULA(IFNA(REGEXEXTRACT(E2:E, "\d+")))

How to put formula in Data Validation List Excel?

I am creating an excel sheet with following Data Validation drop down list.
NA
Done
(add some formula here)
Basically, i will be able to select either plain text "NA"/ "Done" from the dropdown list. But sometimes, I want the user to be able to calculate some values based on the cell respective to the row selected so, I want to have one formula as a choice inside the data validation dropdown list. Is this possible?
Data Validation List Source
When I click on Formulae option, it should execute the formula with respect to the cells in that Row
But currently, the formula that i put in doesn't execute, instead it will just show the whole formula in the cell when activated.
1)How can i make it so that when i select the formula from data validation list, it will execute it instead of filling up the cell with it?
2)How do i set the formula so that it will be using the cell from the current Row? (for example, if i am using the data validation List in N60, the formula should adapt itself to use the cell (let's say A60?).
I may not be able to help with the second part, but I was seeking an answer to the first and discovered a solution/workaround using Name Manager.
First, in Formula > Name Manager, create a new reference (the "refers to" will contain whatever formula you are wishing to ultimately display in the validation list. For this example, we use the formula reference "=IF($H54=..." and Name it "UniqueName"
Now, we go into Data Validation, Select List, and input the three items we want displayed in the list, with an equals sign preceding our newly named reference: ie. "NA,Done,=UniqueName"
Note: You can't start with the =UniqueName or validation will try to read it all as a formula and fail.
This method will allow the user to display "NA", "Done", or "=UniqueName" in the cell; if "=UniqueName" is selected, the cell itself will interpret this as a formula and execute it accordingly, displaying the results of "=IF($H54=...", or whateverelse you have designated to use as a named formula.
If it's too late for yours, I hope this helps someone else who may face a similar problem.
While I think I know what you're trying to say. Why don't you just use an IF formula to evaluate everything instead of selecting a drop down for every row manually. You already had it partially solved using IF. Just need to add the criteria for a "Done" and an "NA"
=if(A1="date","Done",if(A1<"date","NA",if(something else until you have all your catergories))
Just going to piggyback off of Mark's response.
If you really needed your named formula to be the first selection in the list, you can setup your list with a leading comma like so:
,=UniqueName,NA,Done
That worked out for my use, and there was no null item listed in the Data Validation drop down. Hope that helps!

Snippets on google sheets

I have to answer a F.A.Q by google sheets, and I have a list of models answers. I wanted a way to do a snippet in google sheets
for example if a type "#answer1" he replace for my model answer number 1.
Thanks
The best way to do this is to use a combination of an Index and Match function. You could use Vlookup also but I prefer Index Match as it is more flexible and performant.
If you type #answer 1 into any one of cells a1:a3 and then put your lookup table in cells c1:d3 then put the following formula into b1:
=index($D$1:$D$3,match(A1,$C$1:$C$3,0))
cmd/ctrl + d it down to fill the rest of the table.
See: http://i.stack.imgur.com/gWjjh.png