Fill a cell with alternative text when IMPORTRANGE cell is blank - if-statement

I am using the following formula to import data from one spreadsheet to another:
=IMPORTRANGE("URL", "Sheet1!N231")
In some cases the imported range is blank. I would like for these cells to say "TBC" on my new spreadsheet, instead of remaining blank.
I have tried to work in the ISBLANK command but am struggling with the syntax.

try like this:
=IF(IMPORTRANGE("URL", "Sheet1!N231")<>"", IMPORTRANGE("URL", "Sheet1!N231"), "TBC")

Related

ImportRange for last non-empty column

I'm trying to import current inventories from google-form based inventory sheets for multiple rooms (each room's inventory is on a different sheet). I'd like to import the last non-empty row/column from another sheet using ImportRange or similar to grab the last inventory that was done for that space. I've also tried importing these inventories into another sheet in the same document and use the "Sheet 1"!A:A format to grab the last occupied column, but I haven't found a way to grab all 42 cells in the column without needing to type them out one at a time using this formula
"=FILTER('Sheet 1'!2:2 , COLUMN('Sheet 1'!2:2) =MAX( FILTER( Column('Sheet 1'!2:2) , NOT(ISBLANK('Sheet 1'!2:2)))))"
But that just grabs a single cell , instead of the whole column. Any suggestions?
getting the last column:
=ARRAYFORMULA(INDIRECT(
ADDRESS(2, MAX(IF(2:2="",,COLUMN(2:2))))&":"&
ADDRESS(ROWS(A:A), MAX(IF(2:2="",,COLUMN(2:2))))))

Transpose cell data into separate rows

I wanted to see if there was a formula or something that I could do to get something like this accomplished in Google Sheets.
Table 1 is the input I am getting
Table 2 is the output I want to generate on a separate sheet
I am trying to use output I get from a Google form into a Google sheet and create a CSV to import into Google Groups.
=ARRAYFORMULA(TRIM(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
IF(IFERROR(SPLIT(B2:B, ","))<>"", "♦"&SPLIT(B2:B, ",")&
REGEXEXTRACT(A2:A, "(#.*)")&"♣"&A2:A, )),,999^99)),,999^99), "♦")), "♣")))

Search header and return all values below from corresponding column

Trying to wrap an INDEX/MATCH function in ARRAYFORMULA without success.
Here is what I have so far:
=ArrayFormula(JOIN(", ",TRANSPOSE(INDEX(data!$B$2:$E$4,,ArrayFormula(IF(LEN(B2:B),MATCH(B2:B,data!$B$1:$E$1,0),)),))))
My objective is to search the column headings of a sheet and when a match is found, display a CSV array of all of the values below the matching header. My formula does that much, but what I really need to do at this point is somehow convert it to a single formula rather than drag/copy it down the column.
my sample worksheet
=ARRAYFORMULA(IFERROR(VLOOKUP(B2:B, TRANSPOSE({data!B1:E1;
REGEXREPLACE(TRIM(QUERY(IF(data!B2:E<>"", data!B2:E&",", )
,,999^99)), ",$", )}), 2, 0)))

Using a Vlookup formula within an Arrayformula

I'm using the following formula to search a column for "Yes" and it works fine in the cell:
=VLOOKUP("Yes",INDEX(AH:AH,ROW()):INDEX(AI:AI,ROW()+30),2,FALSE)
However, my sheet is over 20000 rows and added to every day so I need to Arrayformula it. The following hasn't worked. I only want the range to search the next 30 rows OR return column two the next time it finds "Yes" in column one.
=arrayformula(IF($A4:$A<>"",VLOOKUP("Yes",INDEX(AH:AH,ROW()):INDEX(AI:AI,ROW()+30),2,FALSE),0))
Appreciate any help.
EDIT:
Below is an image of the spreadsheet. In column AK is the first formula, just a simple Vlookup. As you can see it searches column AH for the next value "Yes" and returns the value in the cell next to it.
Column AM is the same formula wrapped in an Arrayformula but as you can see it is not working.
=ARRAYFORMULA(IF(LEN(A:A), IF(B1:B="yes", C1:C, ), ))

Fuzzy match on google sheets

I'm trying to fuzzy match two columns in google sheets, i've tried numerous formulas but I think it's going to come down to a script to help out.
I have a column with product ID's e.g.
E20067
and then I have another sheet with another column which has image url's relating to this product code such as
http://wholesale.test.com/product/E20067/web_images/E20067.jpg
http://wholesale.test.com/product/E20067/high_res/E20067.jpg
http://wholesale.test.com/product/E20067/high_res/E20067-2.jpg
What I'm wanting to do is "fuzzy" match both of these columns for their product ID, and then create a new column for each match. So it would have the product ID then on the same row in multiple columns each product image URL - like the image below:
Is there a way to do this in google sheets using a script or a formula?
In Google sheets there are a few powerful 'regex' formulas.
Suppose, you have ID list in column A, and URL list in column B
Then use formula:
=REGEXEXTRACT(B1,JOIN("|",$A$1:$A$3))
It will match one of ID's. Drag the formula down to see the result as in picture above.
See more info here
Old thread but, in case you find yourself here, search for my Google Sheets add-on called Flookup. It should do exactly what you want.
For this case, you can use this function:
Flookup (lookupValue, tableArray, lookupCol, indexNum, threshold, [rank], [range])
The parameter details are:
lookupValue: the value you're looking up
tableArray: the table you want to search
lookupCol: the column you want to search
indexNum: the column you want data to be returned from
threshold: the percentage similarity below which data shouldn't be returned
rank: the nth best match (i.e. if the first one isn't to your liking)
range: choose to return the percentage similarity or row number for each match
You can find out more at the official website (examples and such).
Please note that, whereas the OP appears to want the whole list of possible matches, Flookup will only return one result at a time.
Flookup can now return a list of all possible matches through its LRM mode.
Try the following. I am assuming the product codes are in Sheet1 and the URLs are in Sheet2. Both in column A:
=iferror(transpose(FILTER(Sheet2!$A$2:$A,Search("*"& A2 &"*",Sheet2!$A$2:$A))))
Copy down.
If you want to show the image instead of the url try:
=arrayformula(image(iferror(transpose(FILTER(Sheet2!$A$2:$A,Search("*"& A2 &"*",Sheet2!$A$2:$A))))))