Can IF, Contains and VLOOKUP be combined?
Hi all,
I am trying to combine IF and CONTAINS with VLOOKUP (refer following) but it is throwing #INCORRECT ARGUMENT
=IF(CONTAINS("1", {Count}, VLOOKUP("TD", {Mastersheetrng}, 2)))
Can these be combined, or some other combination will work, please help.
Prajna
Answers
-
Hi Pranja,
You can nest a COUNTIF statement within that IF statement to count and see if the number 1 appears somewhere in the {count} range. Then if it does, you can return the VLOOKUP:
=IF(COUNTIF({Count}, CONTAINS("1", @cell)) >= 1, VLOOKUP("TD", {Mastersheetrng}, 2))
If I've misunderstood what you're looking to do, and you have many 1's in the {count} range but you only want to use the LOOKUP on rows that contain a 1, then you may want to check out Paul's solution involving an INDEX(COLLECT in this other Community post, here.
Let me know if this works for you!
Cheers,
Genevieve
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.4K Get Help
- 394 Global Discussions
- 213 Industry Talk
- 449 Announcements
- 4.6K Ideas & Feature Requests
- 141 Brandfolder
- 132 Just for fun
- 131 Community Job Board
- 453 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 293 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!