How to Nest IF statements in the correct order
I am tasked with collecting labor rates per employee, but the labor rates change based on the dates posted. For instance, I have old labor rates applied to dates older than December 1st 2023. We recently had some promotions and now I also have to pull labor rates after March 28th 2024. The labor rates after March 28th are not pulling accurately - they show up as the Q1 rates...
I need help with nesting these if statements in the correct order.
=IF(Date@row > DATE(2024, 3, 28), INDEX({Labor Rates | Internal Uptd 24}, MATCH([Employee Name]@row, {Labor Rates | Employee}), 0), IF(Date@row < DATE(2023, 12, 1), INDEX({Labor Rates | Internal Rate 23}, MATCH([Employee Name]@row, {Labor Rates | Employee}), 0), INDEX({Labor Rates | Internal Q1 2024}, MATCH([Employee Name]@row, {Labor Rates | Employee}), 0)))
Please let me know if I need to provide more information. Thanks in advance for any consideration!
Best Answer
-
Try specifying "0" as the search type for your match conditions:
=IF(Date@row > DATE(2024, 3, 28), INDEX({Labor Rates | Internal Uptd 24}, MATCH([Employee Name]@row, {Labor Rates | Employee}, 0), 0), IF(Date@row < DATE(2023, 12, 1), INDEX({Labor Rates | Internal Rate 23}, MATCH([Employee Name]@row, {Labor Rates | Employee}, 0), 0), INDEX({Labor Rates | Internal Q1 2024}, MATCH([Employee Name]@row, {Labor Rates | Employee}, 0), 0)))
Answers
-
Try specifying "0" as the search type for your match conditions:
=IF(Date@row > DATE(2024, 3, 28), INDEX({Labor Rates | Internal Uptd 24}, MATCH([Employee Name]@row, {Labor Rates | Employee}, 0), 0), IF(Date@row < DATE(2023, 12, 1), INDEX({Labor Rates | Internal Rate 23}, MATCH([Employee Name]@row, {Labor Rates | Employee}, 0), 0), INDEX({Labor Rates | Internal Q1 2024}, MATCH([Employee Name]@row, {Labor Rates | Employee}, 0), 0)))
-
@Carson Penticuff This worked! Thank you so much for the assist!
-
Happy to help!
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!