Nested IF statement with VLookup Formula
Hello,
I have two sheets that contain data from employee responses to different questions. Employees answer at least one question per day.
If an employee answers the question on sheet 1, I need that value, if they dont have a response on that sheet, I need to look and see if there is an answer is on a different sheet. I only want responses for 'Today'. I have a cell in the lookup sheet that has =Today() in a cell that I use as a reference.
I believe this can be done with an IF statement combined with a Vlookup (forgive the syntax)
If({Sheet 1 dateRange1} = Today@row, Vlookup Employee@row, {VlookupRange1}, 2,0), IF({Sheet 2 dateRange2} = Today@row, Vlookup Employee@row, {VlookupRange2},2,0, "missing")
If information does not exist for the person Today on sheet 1, I need to lookup another value on sheet 2. If information does not exist anywhere, I want to return "missing".
Hope that makes sense! Any direction is appreciated.
Best Answer
-
I am assuming the date column is updating daily for each answer. You can try the below formula. The first condition is checking in the Sheet 1, if there is no answer then it will check Sheet 2.
I hope this works for you
=IF(JOIN(COLLECT({Answer}, {Employee Name}, Name@row, {Today Date}, TodayDate@row)) <> "", JOIN(COLLECT({Answer }, { Employee Name }, Name@row, { Today Date }, TodayDate@row)), IF(JOIN(COLLECT({Answer 2}, { Employee Name 2}, Name@row, { Today Date 2}, TodayDate@row)) <> "", JOIN(COLLECT({Answer 2}, { Employee Name 2}, }, Name@row, { Today Date 2}, TodayDate@row)), "Missing"))
Regards
Amit Wadhwani, Smartsheet CoE, Ignatiuz Software, Exton, PA
Best Regards
Amit Wadhwani, Smartsheet Community Champion
Smartsheet CoE, Ignatiuz, Inc., Exton, PA
Did this answer help you? Show some love by marking this answer as "Insightful 💡" or "Awesome ❤️" and "Vote Up ⬆️"https://www.linkedin.com/in/amitinddr/
Answers
-
I am assuming the date column is updating daily for each answer. You can try the below formula. The first condition is checking in the Sheet 1, if there is no answer then it will check Sheet 2.
I hope this works for you
=IF(JOIN(COLLECT({Answer}, {Employee Name}, Name@row, {Today Date}, TodayDate@row)) <> "", JOIN(COLLECT({Answer }, { Employee Name }, Name@row, { Today Date }, TodayDate@row)), IF(JOIN(COLLECT({Answer 2}, { Employee Name 2}, Name@row, { Today Date 2}, TodayDate@row)) <> "", JOIN(COLLECT({Answer 2}, { Employee Name 2}, }, Name@row, { Today Date 2}, TodayDate@row)), "Missing"))
Regards
Amit Wadhwani, Smartsheet CoE, Ignatiuz Software, Exton, PA
Best Regards
Amit Wadhwani, Smartsheet Community Champion
Smartsheet CoE, Ignatiuz, Inc., Exton, PA
Did this answer help you? Show some love by marking this answer as "Insightful 💡" or "Awesome ❤️" and "Vote Up ⬆️"https://www.linkedin.com/in/amitinddr/ -
Hi @Amit Wadhwani - Thank you for the help. The formula is returning 'Missing' for all employees, and I know there is data for Today in both lookup sheets.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!