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
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 466 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!