Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

COUNTIFS with dates

Hi all,

I'm struggling to get a formula to work that can return the number of projects that start within the next 4 weeks. In the main sheet we have a project type column and a project start date column. In the following formula Smartsheet range 1 is the project type and Smartsheet rage 2 is the start date:

=COUNTIFS({Smartsheet Range 1}, "Project type 1", {Smartsheet Range 2}, <=DATE+28)

I have also tried:

=COUNTIFS({Smartsheet Range 1}, "Project type 1", {Smartsheet Range 2}, <=(DATE+28))

I can get it to work with a set date:

=COUNTIFS({Smartsheet Range 1}, "Project type 1", {Smartsheet Range 2}, <=(DATE(2025, 3, 30)))

but I want this to work out the live number of projects so I can add a graph in a dashboard that will constantly update, so need the date to be the current date moving forwards. The above formula will only give a snapshot on that particular date.

Any help would be much appreciated.

Cheers,

Kirk

Best Answer

  • Community Champion
    Answer ✓

    Hi @Kirk Siddals

    Instead of DATE, use the TODAY function for today's date

    TODAY(28) will return today's date plus 28 days.

    =COUNTIFS({Smartsheet Range 1}, "Project type 1", {Smartsheet Range 2}, <=(TODAY(28)))

    For bonus points, I noticed that your formula will include all projects of the correct type that start before or on the date 4 weeks from today which will include those starting before today. If you only want those starting within the next 4 weeks you will need to add another criteria to the COUNTIFS to only include those that start today or later. That would look like this:

    =COUNTIFS({Smartsheet Range 1}, "Project type 1", {Smartsheet Range 2}, <=(TODAY(28)),{Smartsheet Range 2},>=TODAY())

    Hope this helps.

Answers

  • Community Champion
    Answer ✓

    Hi @Kirk Siddals

    Instead of DATE, use the TODAY function for today's date

    TODAY(28) will return today's date plus 28 days.

    =COUNTIFS({Smartsheet Range 1}, "Project type 1", {Smartsheet Range 2}, <=(TODAY(28)))

    For bonus points, I noticed that your formula will include all projects of the correct type that start before or on the date 4 weeks from today which will include those starting before today. If you only want those starting within the next 4 weeks you will need to add another criteria to the COUNTIFS to only include those that start today or later. That would look like this:

    =COUNTIFS({Smartsheet Range 1}, "Project type 1", {Smartsheet Range 2}, <=(TODAY(28)),{Smartsheet Range 2},>=TODAY())

    Hope this helps.

  • Hi KPH,

    That's brilliant, thank you so much for the answer and brilliant solution! Love the addition of the third criteria and will definitely be using it :)

  • Community Champion

    Glad I could help! Thanks for the feedback.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions

  • I'm trying to create a SUMIF formula that looks at the salesperson name in a column and adds up or totals their $ sales in another column. To ultimately show in Dashboard of Totals Sales by Salesperso…
    User: "Allan Z"
    Answered ✓
    8
    2
  • Good day Smartsheet Team, Getting an unparseable error on this formula: =IF($Name@row <> "",(SUMIFS({Expense}, {Period},1, {Type}, OR(@cell = "RES602782", @cell = "RES602497")),"") Trying to pull in a…
    User: "stratman"
    Answered ✓
    15
    2
  • I have a sheet that compiles all the responses from a form. The sheet has multiple start and end date columns, but only one start and one end date cell is NOT blank depending on the activity selected …
    User: "m_anderson"
    Answered ✓
    13
    2