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
- Customer Resources
- 65.1K Get Help
- 444 Global Discussions
- 142 Industry Talk
- 472 Announcements
- 5K Ideas & Feature Requests
- 83 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 489 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!