Formula to replace the "False" with empty cell - google-sheets

I have been using a google sheet formula which is working fine but the problem is formula presenting "false" where Col"G" data is end.
I have tried with IFERROR and multiple things but could not remove it.
Your help towards the problem will be appreciated.
Sheet Link
https://docs.google.com/spreadsheets/d/1IGSRMfqDODklJdPS4_TIMlIZJSM2JXqf_4pWOGjav4I/edit#gid=0

You can't return empty cell as formula result. But if empty string is enough, add it to the value_if_false argument for IF function:
=ArrayFormula(if(len(G3:G),ROUND(IF(LEN(G3:G),IF(G3:G="Probation",0,IF(F3:F>DATE(2021,1,1)*(G3:G="Confirmed"),(13 - MONTH(DATEVALUE(TEXT(F3:F,"mmm")&" 1"))) * 13/12)),0),""),""))

actually, you CAN (and should) return empty cell as the formula result
use:
=ARRAYFORMULA(IF(LEN(G3:G), ROUND(IF(LEN(G3:G),
IF(G3:G="Probation", 0,
IF(F3:F>DATE(2021, 1, 1)*(G3:G="Confirmed"),
(13 - MONTH(DATEVALUE(TEXT(F3:F, "mmm")&" 1"))) * 13/12)), 0), ), ))

Related

Formula works until I make it an arrayformula

I have a formula that works when it is dragged down but it stops working as soon as it's changed to be an array formula - why could this be?
This is the formula that works when dragged down
=IF(AND($W246:W= "Hired",$Y246:Y<>"Y"),"Workforce Needed","Not")
This is an array formula that suddenly doesn't work. (It no longer pulls back "Workforce Needed" when conditions change - despite me running the same test with the original formula and it working then)
=ARRAYFORMULA(
IF(ISBLANK(F91:F),,IF(AND($W91:W= "Hired",$Y91:Y<>"Y"),"Workforce Needed","Not")))
Column W is a data validation drop down (text)
Column Y is an array formula doing a vlookup
Any ideas much appreciated.
The and() function is an aggregating function and will not get row-by-row results in an array formula. To make it work, use Boolean arithmetic, like this:
(W91:W = "Hired") * (Y91:Y <> "Y")
use:
=ARRAYFORMULA(IF(ISBLANK(F91:F),,IF(($W91:W="Hired")*($Y91:Y<>"Y"),
"Workforce Needed","Not")))

how to fix Lookup function error #N/A on google sheet

I have an issue error #N/A Message with VLOOKUP and LOOKUP function, as it is shown on the image I can't find out where is the error, can you help me guys
The value you look up must be found in the first column of the vlookup range.
You can try reordering the columns in an virtual array. For the highlighted cell (in the image you shared) that would make the formula:
=VLOOKUP("5f8961ec", {$K$2:$K$26, $J$2:$J$26}, 2, false)
Of course, you can also replace the value '5f8961ec' with a cell reference.
use in E1 after you delete everything in it:
=INDEX(IFNA(VLOOKUP(A1:A, {K2:K, J2:J}, 2, )))

Please help me with the Formula & ArrayFormula:

I want to return TRUE for blank cells until last value (check out the Required column)
I tried this formula: =AND($A2="" ,$A3:$A <> "") but it didn't work.
Question 1: How can I make 2nd argument i.e. $A3:$A <> "" return true if any one cell in the range $A3:$A is Not Null? Final Formula?
(I know my formula is wrong because it doesn't check every cell in the range mentioned if it is NULL or not, how can I make it check every cell?)
Question 2: ArrayFormula for the corresponding Formula.
(Please suggest if there's any better way to get the Formula & ArrayFromula along with the solution of the method I tried)
Here is the sheet link: https://docs.google.com/spreadsheets/d/1VF38MNcP1e4ieZY47QQq1zOwGYWAmuJ2k9A0WkGYeX0/edit?usp=sharing
EDIT:
I got the Formula: =IFNA(MATCH(FALSE,ArrayFormula(isblank(A2:A)),0),0)>1
For ArrayFormula I just tried wrapping it around but it didn't work: =ARRAYFORMULA(IFNA(MATCH(FALSE,ArrayFormula(isblank(A2:A)),0),0)>1)
I just need the ArrayFormula of this Formula & please tell me what's wrong in my ArrayFormula?
Thank you!
Try below formula.
=ArrayFormula(A2:A10="")
For full column
=ArrayFormula(A2:A="")
Edit: Then use below formula.
=ArrayFormula(INDEX(A:A,2):INDEX(A:A,MAX(IF(A:A<>"",ROW(A:A),0)))="")
try:
=INDEX(INDIRECT("A2:A"&MAX(IF(A2:A="",,ROW(A2:A))))="")
or:
=INDEX(INDIRECT("A2:A"&MAX((A2:A<>"")*ROW(A2:A)))="")
I suggest this simple formula:
=ArrayFormula(NOT(A2:A))
Since any value equates to TRUE and null equates to FALSE, wrapping the range in NOT will return the opposite.
ADDENDUM:
Given additional information from poster:
=ArrayFormula(IF((A2:A="")*(ROW(A2:A)<VLOOKUP(TRUE,SORT({A2:A<>"",ROW(A2:A)},2,0),2,FALSE)),TRUE,FALSE))

dynamic range in arrayformula without using indirect?

I have this formula in spreadsheet that works as supposed. The formula is placed in "O:O" (this one is from O10).
(I've translated the formula from danish - hope I did it right)
=IFERROR(IF(I10<>"";sum(INDIRECT("L"&MATCH(LEFT(B10;LEN(B10)-6);B:B;0)):INDIRECT("L"&ROW()-1));"");"Fejl/Mangler reference")
Here's the result
The data is imported from another sheet and the lines can change over time and there can be added/removed rows that should be taken into consideration in each Sub Total.
This is why I want to convert the formula to an arrayformula - or another solution?
What I thought would work was:
=Arrayformula(IF(ROW(R:R)=5;"Balance";IF(ROW(R:R)<7;"";IF(ROW(R:R)=7;"Sub Total";IF($I:$I<>"";sum(INDIRECT("L"&MATCH(LEFT(B:B;LEN(B:B)-6);B:B;0))&":"&INDIRECT("L"&ROW()-1));"")))))
I guess is the Indirect so I've tried also to do it with a vlookup but that I couldn't figure out either.
Any good ideas?
Here's a link for the document: Spreadsheet
cell P8:
=ARRAYFORMULA(IF(J8:J="";; SUMIF(ROW(O8:O); "<="&ROW(O8:O); O8:O)))
cell O8:
=ARRAYFORMULA(IF(I8:I="";;
SUMIF(ROW(B8:B); "<="&ROW(B8:B); L8:L)-SUMIF(ROW(B8:B); "<"&VLOOKUP(
VLOOKUP(ROW(B8:B); IF(B8:B<>""; {ROW(B8:B)\ SUBSTITUTE(B8:B; " i alt"; )}); 2; 1); {
VLOOKUP(ROW(B8:B); IF(B8:B<>""; {ROW(B8:B)\ SUBSTITUTE(B8:B; " i alt"; )}); 2; 1)\
ROW(B8:B)}; 2; 0); L8:L)))

Google Sheets right() in Sum in Arrayformula returning false values

I've a column of sample data where each cell is either blank or (3 alpha chars, 1 white space, 1 digit). For example:
I need to check if the cell begins with "GTR" or "DBT", then return the number, and sum the return of the column. I'm using the formula below:
=ARRAYFORMULA(sum(IF(OR(left(A1:A10,3)="GTR",left(A1:A10,3)="DBT"),VALUE(right(A1:A10,1)),0)))
The problem is that instead of returning 20, it returns 52.
In fact it appears to return the last char of any cell in the range. (eg. if "A5" has a value of 'someText' the formula returns an error because value() can't parse 't' into a number.
I'd like to know if anyone can tell me how to solve this problem, or if there's something wrong with my formula?
Here's an example of this problem in a Google Sheet:
https://docs.google.com/spreadsheets/d/1XNVUWhI43UW2ABrja8rmplmxhhkSu-je45F-9F_3GQM/edit#gid=0
Thanks,
Onji
The ArrayFormula plus OR will evaluate to TRUE if any of the cells in the range is in the codition, to overcome this remove the OR, and add an IF for every condition, as such:
=ARRAYFORMULA(sum(IF(left(A1:A10;3)="GTR";VALUE(right(A1:A10;1));0);IF(left(A1:A10;3)="DBT";VALUE(right(A1:A10;1));0)))
In addition to the solution of Kriggs, this formula should also work:
=ArrayFormula(sum(if(regexmatch(B3:B12, "GTR|DBT")=TRUE, right(B3:B12)+0,)))

Resources