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

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    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)

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!