Finding and returning values in a range of cells
Hi all,
I'm having a lot of trouble joining cells that contain a certain value (because there is no contain function). I have a range of cells that are all in a single row, and I'm trying to collect all of the cells that contain a certain value, and join them together.
For example, say I had a row with 4 columns that say "Cat","Umbrella Cat", "Dog","Frog", and I'm trying to isolate all of the columns that contain the word "Cat". If this formula worked like I want it to, I would use a combination of Join and Collect functions to return "Cat, Umbrella Cat" in a separate cell. This is as far as I've been able to get: JOIN(COLLECT([Row1]:[Row4],[Row1]:[Row4],="Cat"),", ").
That only gets me "Cat", not the other cell's value that contains the word Cat.
Does anyone have any suggestions on how to isolate and return cells that ~contain~ a certain value, not just equal it? It would be great if Smartsheets could create a contain function and/or allow us to be able to use "FIND" across a range of cells.
Thank you!
Comments
-
Use a FIND function for the word Cat. I would even recommend throwing in a LOWER function to make sure you grab every cell containing the word regardless of upper or lower case.
JOIN(COLLECT([Row1]:[Row4], [Row1]:[Row4], FIND("cat", LOWER(@cell)) > 0),", ").
-
Hi Paul,
Thank you for this - I'm not sure if I'm missing something, but nothing comes up in the cell that I put this formula into. Would this formula search each cell? Or only the one cell I enter in the FIND formula?
Thank you,
Ellie
-
You would not specify a cell within the FIND function. The @cell reference indicates to check each cell within the range.
In taking another look, it seems you are looking across multiple columns along the same row. If this is correct, you are also going to need to adjust your ranges. I am not sure what your exact column names are, but it would end up looking something like this (leave the @row reference):
=JOIN(COLLECT([First Column Name]@row:[Last Column Name]@row, [First Column Name]@row:[Last Column Name]@row, FIND("cat", LOWER(@cell)) > 0),", ")
-
Happy to help!
And just for a little clarification... The @cell reference is more telling the formula to look at each cell within the range on an individual basis.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!