Consider this table:
Col1
Col2
Col3
Col4
1
s
2
3
s
What's the filter formula (or any other formula for that matter) so that it will only retain the rows if any of the cells from col2 to col4 is not empty?
So the output should be:
Col1
Col2
Col3
Col4
1
s
3
s
Google sheet sample here https://docs.google.com/spreadsheets/d/1ugIbzetQGb0IV32iE0aG49wEK1xSuFLHqDUnzoLnGnM/edit?usp=sharing
Thanks! Much appreciated.
One option for Google Sheets:
=FILTER(A1:D4,BYROW(B1:D4,LAMBDA(x,COUNTIF(x,"?*"))))
For ms365:
=FILTER(IF(A1:D4="","",A1:D4),BYROW(B1:D4,LAMBDA(x,SUM(--(x<>"")))))
col1
col2
col3
One
Three
Two
Three
for Col2, the value is not there to compare in "Than", so need to skip. But this column is having value to compare for other test.
Depends on your use case , but you can use null as a value for that column .
I need to build an index table dynamically from the sheetnames of the tabs (BLUE color).
The expected result is shown in YELLOW color.
The rows must be unique along with the sheetnames being displayed in the first column.
I tried in this sheet
Non Formula formula is here: =INDIRECT(CONCATENATE("{",TEXTJOIN(";",true,ARRAYFORMULA("'" &A6:A32 &"'!" & "A2:B")),"}"))
A formula solution is not possible for multiple sheets + indirect.
One option to solve this is to build the dynamic part of your formula with another formula.
Here's what I mean:
The dynamic part of the formula is constructed with this formula:
={"Dynamic part of the formula" ; JOIN(";"&char(10),FILTER("QUERY({"&A2:A&"!A2:C},""select '"&A2:A&"', Col1, Col2, Col3 where Col1 != '' label '"&A2:A&"' ''"")",A2:A<>"")) }
It assumes column A is released for sheet names only. It produces the result like this:
Dynamic part of the formula
QUERY({Sheet1!A2:C},"select 'Sheet1', Col1, Col2, Col3 where Col1 != '' label 'Sheet1' ''");
QUERY({Sheet2!A2:C},"select 'Sheet2', Col1, Col2, Col3 where Col1 != '' label 'Sheet2' ''");
QUERY({Sheet3!A2:C},"select 'Sheet3', Col1, Col2, Col3 where Col1 != '' label 'Sheet3' ''");
QUERY({Sheet4!A2:C},"select 'Sheet4', Col1, Col2, Col3 where Col1 != '' label 'Sheet4' ''")
The final formula uses this part. You'll need to do the next step manually or write a short script for this. Manual process:
Go to a cell with the generated part of the formula. Hit [F2] to enter it, select and copy all. Go to the final formula and replace this part:
={"Sheetname","sub_category","category_filter"; QUERY(UNIQUE({
QUERY({Sheet1!A2:C},"select 'Sheet1', Col1, Col2, Col3 where Col1 != '' label 'Sheet1' ''");
QUERY({Sheet2!A2:C},"select 'Sheet2', Col1, Col2, Col3 where Col1 != '' label 'Sheet2' ''");
QUERY({Sheet3!A2:C},"select 'Sheet3', Col1, Col2, Col3 where Col1 != '' label 'Sheet3' ''");
QUERY({Sheet4!A2:C},"select 'Sheet4', Col1, Col2, Col3 where Col1 != '' label 'Sheet4' ''")
}),"select Col1, Col2, Col3") }
I am sure there must be a more elegant formula to achieve the desired output.
However, this works just fine:
=query(UNIQUE({"Sheetname","sub_category","category_filter","duplicate";{ARRAYFORMULA("Sheet1"&T(SEQUENCE(COUNTA(Sheet1!A2:A))));ARRAYFORMULA("Sheet2"&T(SEQUENCE(COUNTA(Sheet2!A2:A))));
ARRAYFORMULA("Sheet3"&T(SEQUENCE(COUNTA(Sheet3!A2:A))))},{INDIRECT("Sheet1!A2:C"&COUNTA(Sheet1!A1:A));
INDIRECT("Sheet2!A2:C"&COUNTA(Sheet2!A1:A));INDIRECT("Sheet3!A2:C"&COUNTA(Sheet3!A1:A))}}),"Select Col1,Col2,Col3")
Looking for some help...
Is there a way to get the column header name based off the row header name and a value within the body, please note that there are duplicates.
For example from the below table based on RowH2 and table body X, the col1 and col3 column header names should be provided.
Col1 Col2 Col3
RowH1 X
RowH2 X X
RowH3 X
Thanks
Am having some issue using the VLOOKUP function in excel. Am a little new to excel and puzzled as to how to solve this problem. I have two excel sheets.
Sheet 1 looks like:
Col1 Col2 Col3
HIC GSN ND11
H1C 00214 0212107
C4I 07287 0214380
L1A 07731 0214501
Sheet 2 looks like:
Col1 Col2 Col3 Col4 Col5 Col6 Col7
Condition HIC1 HIC1 HIC1 GSN GSN GSN
AMA B60 B61 B62 02934 02935
ALD H1A H1C 04821 03473
HEC W0A W0B
The VLOOKUP formula that am using is:
=VLOOKUP(B2,'Conditions.xlsx]Conditions'!$B$2:$BH$24,60,0)
Here B2 refers to Sheet 1, Column 1. Index Number 60 is a repeated Column 1 in Sheet 2. Is there a better way to lookup the COl1 and Col2 in Sheet one to extract the Conditions Columnin Sheet 2?
Any help would be great.
Read this: How to use INDEX MATCH instead of VLOOKUP
But what happens if you want to look from right to left? VLOOKUP simply can't do that. INDEX/MATCH can.