Change date based on IF(AND formula
Hi,
I have a problem with my formula and I really hope you can help.
So basically looking at my formula, the “{2B-0.5 Service Parts Order (Oct) Range 1}“ is the part number (reference to the column in different sheet) and it needs to be the same as the part number column in the sheet where the formula is, {2B-0.5 Service Parts Order (Oct) Range 2} is referencing the column in the other sheet - this column is a CSPL Name and it needs to be the same as the CSPL NAME in the sheet where the formula is. If both conditions are met, then smartsheet needs to look at the PO Submission Date column and add a specific number of days to this date - the number of days is provided in the different sheet {2B-0.5 Service Parts Order (Oct) Range 3} - it needs to look for a line with needed part number and CSPL name and then take a number of days from the highlighted column (range 3) and add it to the PO submission date.
My formula looks like that:
=IF(AND({2B-0.5 Service Parts Order (Oct) Range 1} = [Part Number]@row, {2B-0.5 Service Parts Order (Oct) Range 2} = [CSPL Name]@row), [PO Submission Date]@row + {2B-0.5 Service Parts Order (Oct) Range 3})
It doesn't work as I get the invalid operation error.
Can you advise please?
Best Answer
-
You will first need an INDEX/COLLECT to pull over the number of days based on the match and then add it to the date.
=[PO Submission Date]@row + INDEX(COLLECT({2B-0.5 Service Parts Order (Oct) Range 3}, {2B-0.5 Service Parts Order (Oct) Range 1}, @cell = [Part Number]@row, {2B-0.5 Service Parts Order (Oct) Range 2}, @cell = [CSPL Name]@row), 1)
Answers
-
You will first need an INDEX/COLLECT to pull over the number of days based on the match and then add it to the date.
=[PO Submission Date]@row + INDEX(COLLECT({2B-0.5 Service Parts Order (Oct) Range 3}, {2B-0.5 Service Parts Order (Oct) Range 1}, @cell = [Part Number]@row, {2B-0.5 Service Parts Order (Oct) Range 2}, @cell = [CSPL Name]@row), 1)
-
@Paul Newcome it worked - thank you!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!