Index/Collect with a date being one of the criteria

Options

Hi,


I'm trying to write an index/collect formula and one of the criteria is that the date is yesterday. I'm having trouble. Any suggestions?


=INDEX(COLLECT({Evergreen Totals}, {Admission Type}, "Start of Business", {Date}, TODAY() - 1, 1))


Thank you!

Tags:

Answers

  • Heather Duff
    Heather Duff ✭✭✭✭✭✭
    edited 01/07/22
    Options

    Hi @Automations 1 ,


    I think you're close! Try this: =INDEX(COLLECT({Evergreen Totals}, {Admission Type}, "Start of Business", {Date}, TODAY(-1), 1))

    The parenthesis after TODAY are where you enter the adjustment to how many days before (negative) or after (positive) today.


    Hope this helps! Let me know if it works!


    Best,

    Heather

  • Automations 1
    Automations 1 ✭✭✭✭✭
    edited 01/07/22
    Options

    @Heather Duff Thanks, but I'm still getting #Incorrect Argument


    I ended up creating a helper column with an if statement that checks if the date is yesterdays date, so i got the results i wanted. But I am curious why the Today(-1) function is not working.

  • Heather Duff
    Heather Duff ✭✭✭✭✭✭
    Options

    @Automations 1 Try moving the parenthesis:

    =INDEX(COLLECT({Evergreen Totals}, {Admission Type}, "Start of Business", {Date}, TODAY(-1)), 1)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!