Apr 15 2022 12:31 PM
Good afternoon, hope someone can help.
so here goes.
i have a spreadsheet that has 8 columns the first Column is a list of companies named and numbered starting in A6 down to A52. Then I have four columns with general info and the last three columns named operator 1, operator 2, operator 3. These are the columns where you will have to input an operator name from a list of +- 35 operator names and these can be put in either column G, H and I. With that said you can have the same name in any of the columns but on a different row.
hope the above makes sense.
now here is what I want to do. I want to be able to filter all 3 columns at the same time. I created a drop down list with all 35 operators as I thought I could then validate that against columns G, H and I. And simply display that on second sheet.
thanks
Apr 15 2022 01:05 PM
=FILTER(A6:I52,(G6:G52=K3)+(H6:H52=K3)+(I6:I52=K3))
Maybe with this formula. Enter the filter criteria dynamically in cell K3.
Apr 15 2022 02:26 PM
Do you have Excel 365, because FILTER is one of the dynamic array functions that came out in 2018.
The following involves lambda functions simply because I am trying to change the way in which I program Excel.
= FILTER(table, BYROW(operators=selected,ORλ))
where
ORλ = LAMBDA(x,OR(x))
Apr 15 2022 03:00 PM
Apr 15 2022 03:47 PM
In that case, this should demonstrate the formula works. It may be a couple of steps too far for implementation but, hopefully, of interest.
Apr 15 2022 05:23 PM
Apr 16 2022 02:32 AM
You are correct. That relationship between the formula location and the placement of the results is the key feature that makes spreadsheets an implementation of functional programming, as opposed to imperative programming. Each value is determined by its definition (associated by sharing a cell) and it cannot change as a result of the state of the calculation elsewhere.
You may well find @OliverScheurich's implementation easier to follow. He has written out tests for the 3 columns explicitly and used '+' as the equivalent of an 'OR' operator acting row by row. All I have done is to use more modern functionality 'BYROW' to run through the dataset row by row and embedded the 'OR' within a Lambda function so that it can accept the row ranges from 'BYROW'.
I might even speculate that the more experience one has of traditional spreadsheet working, the harder the move to modern Excel. Others may be of a different opinion!
Apr 16 2022 06:17 PM
Apr 17 2022 07:49 AM
=FILTER(A6:I52,COUNTIF(OFFSET(G6:I6,ROW(1:47)-1,0),K3)>0)
You can try the above formula to filter multiple occurences of the value entered in cell K3.
=FILTER(A6:I52,(G6:G52=K3)+(H6:H52=K3)+(I6:I52=K3))
I don't understand why this formula doesn't work in your sheet. Can you attach a screenshot of your file where the data, formula and error is shown?
Apr 17 2022 09:59 AM
@OliverScheurich
Happy Easter! So I kept messing with it after I posted the reply. I ended up deleting the file and made a new copy of my master sheet. So I knew it would be 100% clean. Meaning no left behind functions I tried before I asked help on this forum.
and you are correct it works flawlessly.
Thank you so much for your patience and help. ( and that goes for everyone who responded ) Now have another question or maybe 2.
Can I put this on sheet 2 and let it grab the information from sheet 1?
and to make it more legible can I return a blank cell for any value that does not match my search criteria?
Apr 17 2022 10:45 AM
Happy Easter to you too, thank you!
=FILTER('sheet 1'!A6:I52,('sheet 1'!G6:G52=K3)+('sheet 1'!H6:H52=K3)+('sheet 1'!I6:I52=K3))
The above formula grabs the data from sheet 1.
The result includes this data for company 1:
company1 | 4 | 6 | 6 | 14 | 0 | operat 9 | operat 24 | operat 20 |
In order to increase the legibility, do you want to return this instead?
company1 | 4 | 6 | 6 | 14 | 0 | operat 24 |
Apr 17 2022 10:50 AM
To move stuff from sheet 1 to Sheet 2, grab the region you wish to move with a mouse select and use Ctrl/X for 'Cut'. Turn to sheet 2 and type Ctrl/V in the corresponding location. Assuming you are using FILTER, the function contains another parameter which allows you to return a message or, even, to perform an alternative function.
Apr 17 2022 05:57 PM
Apr 18 2022 02:17 AM
=LET(operator1,IF(FILTER('sheet 1'!G6:G52,('sheet 1'!G6:G52=K3)+('sheet 1'!H6:H52=K3)+('sheet 1'!I6:I52=K3))<>K3,"",K3),
operator2,IF(FILTER('sheet 1'!H6:H52,('sheet 1'!G6:G52=K3)+('sheet 1'!H6:H52=K3)+('sheet 1'!I6:I52=K3))<>K3,"",K3),
operator3,IF(FILTER('sheet 1'!I6:I52,('sheet 1'!G6:G52=K3)+('sheet 1'!H6:H52=K3)+('sheet 1'!I6:I52=K3))<>K3,"",K3),
company,FILTER('sheet 1'!A6:F52,('sheet 1'!G6:G52=K3)+('sheet 1'!H6:H52=K3)+('sheet 1'!I6:I52=K3)),
result,CHOOSE({1,2,3,4,5,6,7,8,9},company,company,company,company,company,company,operator1,operator2,operator3),
result)
Maybe with this formula.