Vlookup & IF
Hi team,
I am trying to refer to another sheet which has active and inactive employees on it, some are returned employees so their name is twice on the sheet. However I only want the Vlookup to refer to Active employees.
I've tried these options with no success -
=IF({HRMS Current & Ex Employees Range 1} = "Active", VLOOKUP([Full Name]@row, {HRMS Current Employees Range 2}, 19, false), 0)
=IF({HRMS Current & Ex Employees Range 1}@row = "Active", VLOOKUP([Full Name]@row, {HRMS Current Employees Range 2}, 19, false), 0)
=IF({HRMS Current & Ex Employees Range 1} = "Active", VLOOKUP([Full Name]@row, {HRMS Current Employees Range 2}, 19, false))
This formula works fine but doesn't always refer to the active employee -
=VLOOKUP([Full Name]@row, {HRMS Current Employees Range 2}, 19, false)
Any help appreciated!
Best Answer
-
Hey @Josephine
An INDEX/COLLECT will accomplish what you need. The range in this function combo will be single columns, not a table as used in VLookUp.
=INDEX(COLLECT({source sheet employee column (what was 19 in table)}, {source sheet employee column to match to (what was 1 in table)},[Full Name]@row,{source sheet status column}, "Active"),1)
Will this work for you?
Kelly
Answers
-
Hey @Josephine
An INDEX/COLLECT will accomplish what you need. The range in this function combo will be single columns, not a table as used in VLookUp.
=INDEX(COLLECT({source sheet employee column (what was 19 in table)}, {source sheet employee column to match to (what was 1 in table)},[Full Name]@row,{source sheet status column}, "Active"),1)
Will this work for you?
Kelly
-
Thank you! worked perfectly and I now know about INDEX/COLLECT!
-
Great! The Index/Collect is a powerful function combo. Another formula to explore is INDEX/MATCH which is used when one has only one criteria to consider. Both Index/Match and Index/Collect may increase sheet performance over the VLookUp.
Kelly
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.3K Get Help
- 364 Global Discussions
- 199 Industry Talk
- 428 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 444 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!