Spreadsheet Matching Cells - google-sheets

Hello Guys could you help me with formula.
I have
Cell "A1" contain "NJ"
Cell "B1" Contain "NY"
I want to have C1 to return "Long Distance"
Or
If Cell "A1" contain NJ
Cell "B1" Contain NJ
I want to have C1 to return "Local"
Thank you so much for you help.
I have tried Index formula but didnt work.

use:
=IF(A1=B1; "Local"; "Long Distance")

Related

google spreadsheet IF a cell contains some words included in another cell

I'm trying to check if a cell contains some words included in another cell, if yes it should say "Valid".
For example, if cell A2 is Jon Doe Street and cell B2 is 230 Jon Doe it should say "valid"
I'm using this formula
=IF(ISNUMBER(SEARCH($B2,C2)),"Valid","")
but it only works for some rows.
This is a sample you can check
https://docs.google.com/spreadsheets/d/1S5m_kV0td9_nq8vWZGkSneCEXGnLHL_af1hlzn2sz0I/edit?usp=sharing
How can i fix it?
thanks!
use:
=IF(SUM(BYCOL(SPLIT(B2," "),LAMBDA(ax,IFERROR(--REGEXMATCH(C2,ax)))))>=2,"VALID",)
arrayformula
=MAP(B2:B,C2:C,LAMBDA(abx,cx,IF(SUM(BYCOL(SPLIT(abx," "),LAMBDA(ax,IFERROR(--REGEXMATCH(cx,ax)))))>=2,"VALID",)))
-

Arrayformula to return last non-empty cell in multiple rows

I need help formulating an arrayformula on how to return the last non-empty cell in a row across multiple rows.
The formula will be in column A in cell A2 and the output will look like this in column A:
The formula I have is only for 1 row. I need the formula (only 1 formula) to return the last non-empty cells of 1000+ rows.
This is the current formula I have but it's only for 1 row. I need to drag it down every time I add a new row:
=LOOKUP(1, ARRAYFORMULA(1/(B2:Z2<>"")),B2:Z2)
Is there an arrayformula that can do this across multiple rows without dragging down the formula?
any help would be appreciated. Thank you very much.
try:
=INDEX(REGEXREPLACE(TRIM(FLATTEN(QUERY(TRANSPOSE(
SUBSTITUTE(B2:Z, " ", CHAR(13))),,9^9))), ".* ", ))

sum all of previous value with one row formula

I want to sum-up all of previous value.
for example like image.
If current cell is C2, then show A2.
If current cell is C3, then show SUM(A2:A3).
If current cell is C4, then show SUM(A2:A4)
So in cell C2 , your start cell, put:
=Sum(A$2:A2)
Now copy paste it to all the cells in the column you want - C, or simply Drag Down the formula.
Probably more alternatives, but try:
Formula in B2:
=ArrayFormula(IF(LEN(A2:A),(SUMIF(ROW(A2:A),"<="&ROW(A2:A),A2:A)),))
try in C2:
=ARRAYFORMULA(IF(A2:A="";;MMULT(TRANSPOSE((ROW(A2:A500)<=
TRANSPOSE(ROW(A2:A500)))*A1:A500); SIGN(A2:A500))))

Include link created with CONCATENATE from one cell into IMPORTHTML formula in another cell

I am generating a link combining two values from two cells C2 and D2 using CONCATENATE formula in cell B2. Then I want to include generated link into another formula =IMPORTHTML("URL"; "table"; 3 ) in A2 cell. A simple pointing of a cell B2 in field "URL" in the abovementioned formula did not give a good result. Please help fix syntax.
Instead of
"B2"
Use
B2
The formula will be
=IMPORTHTML(B2;"table";3)

Fill column with maximum/last value from another column

How can I get the result as in example with ARRAYFORMULA up to last filled cell A?
I can do it with formula in cell C1 =MAX(B$1:B1) but in that case have to copy the formula in each cell in turn.
In C2 try:
=ArrayFormula(if(row(A2:A) <= max(if(not(isblank(A2:A)), row(A2:A))),vlookup(row(A2:A),filter({row(A2:A),B2:B},len(B2:B)),2),))
See this spreadsheet for an example.

Resources