Google Sheet Array Formula Put blank - if-statement

I have this formula
=ArrayFormula(IF(LEN(C$3:F$3), H4:L4+C4:F4/$C$1, ""))
How i can modify this array formula to return Blank like in I7?

try:
=BYROW(B34:F38, LAMBDA(x, INDEX(SPLIT(TEXTJOIN(" ", 1, x), " "),,1)))

Related

Having a problem with IF function argument in Spreadsheet

I'm trying to make this description generator, and I can't seem to make the first part work for one of the IF arguments as it does with the rest. It only checks the logical expression but doesn't bring the rest of the text body in the cell joined with & as it does in the case of the other IF arguments I have there linked one after the other. This example should make more sense.
try:
=INDEX(REGEXREPLACE(SUBSTITUTE(SUBSTITUTE(TRIM(FLATTEN(QUERY(TRANSPOSE(IF(IFERROR(
SPLIT(B1:B, CHAR(10)))="",,REGEXREPLACE({"", SEQUENCE(1, 100)}&". "&IFNA(VLOOKUP(
TRIM(SPLIT(B1:B, CHAR(10))),
{"ck", "click >";
"box", "select box";
"scd", "scroll down >"}, 2, 0),
SPLIT(B1:B, CHAR(10))), " ", CHAR(13)))),,9^9))),
" ", CHAR(10)), CHAR(13), " "), "^\. !?", ))
demo sheet
The first If statement encloses all the rest of the formula so if the regex matches "ck" the condition is satisfied, you get "click >" but nothing else happens. I think you can just move the final bracket so it is just after "select " like this:
=IF(REGEXMATCH(B4, "ck"),"click >",IF(REGEXMATCH(B4, "scd"),"scroll down > ",IF(REGEXMATCH(B4, "!"),"","select "))) & ARRAYFORMULA(REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(TEXTJOIN(CHAR(10), 1, IF(REGEXMATCH(""&
SPLIT(B4, CHAR(10)), "^>.*"),
SPLIT(B4, CHAR(10)), TRANSPOSE(MMULT(TRANSPOSE(TRANSPOSE((SEQUENCE(1, COLUMNS(
SPLIT(B4, CHAR(10))))<=SEQUENCE(COLUMNS(
SPLIT(B4, CHAR(10))), 1, 0))*NOT(REGEXMATCH(
SPLIT(B4, CHAR(10)), "^>.+")))), TRANSPOSE(SIGN(NOT(REGEXMATCH(
SPLIT(B4, CHAR(10)), "^>.+"))))))&". "&
SPLIT(B4, CHAR(10)))), "^0. ", ),"scd",""),"ck",""),"!",""))

How to create result from multiple IF results neatly in Google Sheets

I want to combine multiple results of if statement into a form of a sentence.
Code:
=CONCAT("Fail column", IF($T3="No", " T", "")& IF($U3="No", ", U", "") & IF($W3<7, ", W", "") & IF($X3>3, ", X", "") & IF($AE3="No", ", AE", "") & IF($AF3="No", ", AF", ""))
Sample data :
If the first statement returns blank, the next statement would not show the comma at the beginning. And let say all pass, they would be shown as "Yes".
My expected output can be:
Fail column T, U, W, X, AE, AF
Fail column U, W, X, AE, AF
Fail column T
Fail column W, X
Yes
I'm thinking you could try:
Formula in R3:
=IF(OR(T3="No",U3="No",W3<7,X3>3,AE3="No",AF3="No"),"Fail column: "&TEXTJOIN(", ",TRUE,IF(T3="No","T",""),IF(U3="No","U",""),IF(W3<7,"W",""),IF(X3>3,"X",""),IF(AE3="No","AE",""),IF(AF3="No","AF","")),"Yes")
The key here is TEXTJOIN instead of CONCAT to exclude any empty values from the concatenated string.
Note: Excel and Google Spreadsheets are two different apps and the functions are not always exchangeable. Your question's title suggests that you are actually using Excel, however your tags include GS.
correct formula would be:
=ARRAYFORMULA(REGEXREPLACE(IF(
(T3:T="yes")*(U3:U="yes")*((W3:W<7)*(W3:W<>""))*(X3:X>3)*(AE3:AE="yes")*(AF3:AF="yes"),
"yes", "Fail column: "&
IF(T3:T="no", "T, ", )&
IF(U3:U="no", "U, ", )&
iF(W3:W>=7, "W, ", )&
IF((X3:X<=3)*(X3:X<>""), "X, ", )&
IF(AE3:AE="no", "AE, ", )&
IF(AF3:AF="no", "AF, ", )), ", $|Fail column: $", ))

proper IF statement issue causing parse error

I am searching for a formula to combine three things. To capture the value of Cell A into cell B. If it has has a number then it should capture that number. If the value of cell A1 is - then it should change to blank in cell B1 and if it has a blank cell in A1 Then it should be blank in B1.
I have tried the formula in google sheet with IF, And OR combining but it is giving an error.
=if(OR(A1="-"," "),(A1=" ", " "))
=if(And(A1="-"," "),(A1=" ", " "))
=IF(A1="-"," ",IF(A1="","",IF(A1=" "," ")))
The expected results are giving an error or it gives the answer as false.
You should take a look at IF documentation to understand it better, but the main thing here is to remember that IF is IF(logical_expression, value_if_true, value_if_false)
The best option here would be to go with player0 solution, because it covers up almost every case: =IF(ISNUMBER(A1), A1, )
But just to help you out on understanding what was wrong with your formulas, even though those solutions don't check if A1 is a number:
=if(OR(A1="-"," "),(A1=" ", " "))
The correct way would be: =if( OR(A1="-",A1=" "), " ", A1)
=if(And(A1="-"," "),(A1=" ", " "))
This one is actually conceptually wrong, because you want to check if A1 = "-" AND A1 =" ", which is impossible and will never be true, because a cell can't be equal to "-" and " " at the same time.
=IF(A1="-"," ",IF(A1="","",IF(A1=" "," ")))
The correct way would be: =IF(A1="-"," ",IF(A1="","",IF(A1=" "," ",A1)))
that is not how you should use IF function.
If the value of cell A1 is - then it should change to blank in cell B1 and if it has blank cell in A1 Then it should be blank in B1
which could be solved like this in B1 cell:
=IF(ISNUMBER(A1), A1, )
and arrayformula of that would be:
=ARRAYFORMULA(IF(ISNUMBER(A1:A*1), A1:A, ))

Reference text from cell and return remaining text to other cell

So my question is... I have 2 columns, A and B. In B I want to read the text from A (which has a list of texts: eg. Normal Car, Lorry, Sports Car, Bike) and I would type some text specified from the list in 'A' (eg. Bike) and in B would be the text that is left from that list from 'A' (So meaning "Normal Car", "Lorry" and "Sports Car" would be shown in 'B')
How do I do that?
This is the spreadsheet example:
https://docs.google.com/spreadsheets/d/16o75-R-U3zY0vajg1pO0N7-t9uGCtt_B2QiZLW_sXUM/edit#gid=0
Here are all the words that will be used: Lyrics, Visualizer, Bass Boost, 8D, Nightcore, Image Only
What I want to achieve is if I fill one or more of the words in Column A, then all the rest of the words will be filled up in B automatically. I left them filled up already so you can see the example. Thanks.
for one word:
=ARRAYFORMULA(REGEXREPLACE(TRIM(IF(LEN(A1:A),
REGEXREPLACE("Lyrics, Visualizer, Bass Boost, 8D, Nightcore, Image Only,",
A1:A&",", ), )), ",$", ))
for multiple words:
=ARRAYFORMULA(SUBSTITUTE(SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(IF(LEN(A1:A), SUBSTITUTE(
REGEXREPLACE({"Lyrics", "Visualizer", "Bass Boost", "8D", "Nightcore", "Image Only"},
REGEXREPLACE(A1:A, ", ", "|"), ), " ", "♦"), )),,999^99))), " ", ", "), "♦", " "))
I would type some text specified from the list in 'A' (eg. Bike) and in B would be the text that is left from that list from
try like this:
=ARRAYFORMULA(REGEXREPLACE(TRIM(REGEXEXTRACT(A1:A, "(.*)"&B1:B)), ",$", ))

Counting words in ARRAYS with ARRAYFORMULA in Google Sheets

Counting words with Array formula for every cell won't work.
I have tried to use:
=ARRAYFORMULA(COUNTA(SPLIT(Range, " ")))
=ARRAYFORMULA(SUM(COUNTA(SPLIT(Range," "))))
Both didn't work.
I expected ARRAYFORMULA to count words for every cell in the column and put it next to it, but it counted all the text and put it in one cell instead.
Copy of the sheet (Problem in Cell D123): https://docs.google.com/spreadsheets/d/1pPbJ9k4tiLk8hVxHXRgvu6b4vxJOcgTmyFhD_g8gc_Q/edit?usp=sharing
=ARRAYFORMULA(IF(LEN(A3:A),
MMULT(IF(IFERROR(SPLIT(IF(LEN(A3:A), A3:A, ), " "))<>"", 1, 0),
ROW(INDIRECT("A1:A"&COUNTA(IFERROR(
QUERY(IF(IFERROR(SPLIT(IF(LEN(A3:A), A3:A, ), " "))<>"", 1, 0), "limit 1", 0)))))^0), ))
also could be done by just counting the spaces:
=ARRAYFORMULA(IF(LEN(A3:A), LEN(REGEXREPLACE(A3:A, "[^\s]", ))+1, ))