Using INDEX/COLLECT with an OR statement?
I'd like to pull a value from another sheet based on a cell value in my current sheet Matching either 1 of 2 columns in my other sheet.
INDEX(COLLECT({Range where value I want to pull is located}, {Column 1 where I'd like to Match cell with}, @cell, OR({Column 2 where I'd like to Match cell with}, @samecell),0))
This way, if @cell has a match of either column 1 or column 2, it pulls the value from the specified column in the beginning of my formula.
Now from what I understand about the OR operator is that it works best with definitive statements for single cells, but I need to match based on the contents of 1 of 2 column ranges.
Thanks.
Answers
-
Nevermind, the below will not work!
Essentially, by using an OR you're really only giving it one criteria to match, so an INDEX/MATCH may work better here. I have no idea if this will work though! Try placing both your Critera range / criteria pairs for the OR inside the OR, separated by a comma:
INDEX({Range where value I want to pull is located}, MATCH([CellThatIWantToMatch]@row, OR({Column 1 where I'd like to Match cell with}, {Column 2 where I'd like to Match cell with}), 0))
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
@Jeff Reisman no worries! I think what I'll have to do is create a helper column which concatenates the two columns I am checking in, and then incorporate the Contains function with the cell that I want to match
-
That's a good plan! I am a big fan of helper columns for stuff like this!
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives