Use cell text to define vlookup datatable range - datatable

In the image above, how do I replace the portion "Tom.A:C" in the vlookup function with the text in cell B2 + .A:C ?
Where "Tom" is the name of a sheet in my workbook and I want to lookup a value in the second column of that sheet.

The formula
=VLOOKUP(lookup,sheet!range,column,match)
Then, in your example, you must write it like this:
=VLOOKUP(A2, TOM ! [Range of the sheet], 2, FALSE)
Edit:
I did not understand the first time exactly what was the question, so here it is the answer:
The formula
=VLOOKUP(lookup,indirect(concat(<cell with sheetname>,<"!"|".">,"<CELL RANGE IN ALL LOOKING SHEETS>")), column, match)
Then in your example:
=VLOOKUP(A2, indirect(concat(A2,".","A:C")), 2, 0)
First you need to concatenate the value of the sheet and range that you want, then with indirect, you take that string value and use it as a valid reference.

Related

CountIFS with filter

Syntax:
CountIfS(Range1, condition1, Range2, Condition2,.... So on)
Can we use FILTER function to retrieve a value.
I am trying below function
=COUNTIFS(A2:A610, "Yes", $B$2:$B$610, FILTER(Sheet2!14:14, Sheet2!2:2=G1))
The output is not correct answer, neither the its throwing any error.
I could save the output of filter(Sheet2!14:14,Sheet2!2:2=G1) in different cell and refer that cell in 2nd condition. But for that I need make plethora cells as I need to use this countifs function in every column.
PS : filter(Sheet2!14:14,Sheet2!2:2=G1) returns the correct value.
that's not how it works. the output of your FILTER formula needs to be exactly 609 cells to match the range of your COUNTIFS formula. only then your formula will work.
in your case try:
=COUNTA(IFNA(FILTER(A2:A; A2:A="yes"; REGEXMATCH(B2:B;
TEXTJOIN("|"; 1; FILTER(Sheet2!14:14; Sheet2!2:2=G1))))))

Why is sort function not sorting in Google Sheets

I have on row one cell A1 = 3, E1=9, I1=4.
If in cell K1 I write: =CONCATENATE(A1:I1) I get 394
But if I try to sort the cells before concatenating them with =CONCATENATE(SORT(A1:I1)) I still get the same result. Why?
This is due to the principle of the SORT function, which sorts rows according to data in columns. It does not sort individual cells. The example in the link explains more.
If you want to get the result that you anticipate, transpose your data and place them: A1=3, A5=9, A9=4
and perform: =CONCATENATE(SORT(A1:A9, 1, TRUE)), which gives you 349.
Or if you need to stick with row, transpose the cells in between. Use your original cell configuration and perform: =CONCATENATE(SORT(TRANSPOSE(A1:I1), 1, TRUE))
Note: Those additional parameters are required according to the SORT function help, however it seems that 1 and TRUE are used by default if they are missing.

google spreadsheets - filter a cell by it's address

I am using the filter function to find non blank values, the classic:
=FILTER(A2:A99, NOT(ISBLANK(B2:B99)))
To find all the column A headings that have a non-blank value in column B.
But I would also like to always include the last value regardless of it's ISBLANK, something like:
=FILTER(A2:A99, (CELL("address",A2:A99)="$A$99") OR NOT(ISBLANK(B2:B99)))
But this gives me an error, leading me to the strange question of how do I get this to work:
=FILTER(A2:A99, CELL("address",A2:A99)="$A$99")
Or something similar?
As CELL function does not play well in array formulas, you can get addresses as strings for cells like this:
=ARRAYFORMULA(ADDRESS(ROW(A2:A99), COLUMN(A2:A99)))
As for your original problem, you can just add the last cell as the last row:
={FILTER(A2:A98, NOT(ISBLANK(B2:B98))); A99}
Or a dynamic version:
=FILTER(A2:A99, (NOT(ISBLANK(B2:B99))) + (ROW(A2:A99) = (ROWS(A2:A99) + ROW(A2) - 1)))

If value in column A of Sheet1 appears twice in column B of Sheet2, highlight value in Sheet1

Conditional Formatting - If a value in column A of sheet 1 appears twice in column b of sheet 2, highlight the cell in sheet 1
I've been messing with the indirect modifier to see if I can get this to work.
=COUNT(INDIRECT("'Order Confirmation'!B:B"),A1)
But this has currently just highlighted all the cells on sheet 1 column a. I have tried
=COUNT(INDIRECT("'Order Confirmation'!B:B"),A1>2)
=COUNT(INDIRECT("'Order Confirmation'!B:B"),A1=2)
and this has changed nothing. I would appreciate some assistance
if Sheet2 is like:
then Sheet1 will be like:
=FILTER(A1, COUNTIF(FILTER(INDIRECT("Sheet2!B:B"),
COUNTIF(INDIRECT("Sheet2!B:B"), INDIRECT("Sheet2!B:B"))>1), A1))
UPDATE:
=FILTER(A1, COUNTIF(FILTER(INDIRECT("'Order Confirmation'!B:B"),
COUNTIF(INDIRECT("'Order Confirmation'!B:B"),
INDIRECT("'Order Confirmation'!B:B"))>1), A1))
...as a custom formula because you have numbers in dataset not text

how to ARRAY specific cells based on rules?

is there a (maybe a one (?) formula)-way how to pick all green cells (but only those which has numbers and excluding 0) in a row and put/list them in an array to that coresponding row ??
example: in cell AO1 there will be formula that will list these results:
AO1 = 647
AP1 = 2806
AQ1 = 15490
AR1 = 32105
AS1 = 33808
something like array of constants but constant will be a cell reference... I can only think of a hard way to doing it like make a table/grid of all green cells and then array them, but not sure how could I exlude things from arraying (things like: skip empty cell and skip cell that is "<1" )
edit: in another words: cell AO1: =arrayformula({$p$1;$r$1;$t$1;$v$1;$x$1;$z$1;$ab$1;$ad$1;$af$1;$ah$1;$aj$1;$al$1};and dont array empty and "<1" cells)
If the row are fixed could simply use filter on all the rows
like this : (I used the range you give in your question)
=FILTER(
{$p$1;$r$1;$t$1;$v$1;$x$1;$z$1;$ab$1;$ad$1;$af$1;$ah$1;$aj$1;$al$1};
{$p$1;$r$1;$t$1;$v$1;$x$1;$z$1;$ab$1;$ad$1;$af$1;$ah$1;$aj$1;$al$1}>0)
And for the K and the unique you can add them like this:
=ARRAYFORMULA(UNIQUE(FILTER(
{$p$1;$r$1;$t$1;$v$1;$x$1;$z$1;$ab$1;$ad$1;$af$1;$ah$1;$aj$1;$al$1};
{$p$1;$r$1;$t$1;$v$1;$x$1;$z$1;$ab$1;$ad$1;$af$1;$ah$1;$aj$1;$al$1}>0))&" K")

Resources