Use SUMIFS referencing start and end dates from another sheet

Hello,

I have three sheets. The first one has four attributes (Let's call it Main):

[ID, Observation Date, Group, Count]

image.png

The second one has three (Let's call it Week):

[Week ID, From Date, To Date]

image.png

The third has all the Groups listed and the corresponding weeks where the counts will be displayed based on met criteria (Summary sheet).

image.png

I'm using SUMIFS to calculate the count if the ID matches my criteria, and the Observation Date falls between Start Date and End Date in the sheet 'Week.'

Here are my two attempts:

=SUMIFS({Count}, {Group}, "Zildj", {Observation Date}, >={From Date}, {Observation Date}, <={To Date})

=SUMIFS({Count}, {Group}, "Zildj", {Observation Date}, AND(>={From Date}, <={To Date})

I am trying to sum data from Main where the count occurred between the two dates from the Week sheet, then display everything in the Summary sheet. I am using the Week sheet to drive the 52-week calendar.

Thank you for your assistance.

Tags:

Best Answer

Answers

  • Ape_Man819
    Ape_Man819 โœญโœญโœญโœญ

    You're on the right track with usingย SUMIFS, but Smartsheet formulas don't support logical operators likeย >=ย orย <=ย directly inside the formula the way Excel does. Instead, you need to useย cell referencesย orย cross-sheet referencesย that already contain the date values you're comparing against.

    Hereโ€™s how you can structure your formula correctly:

    SUMIFS({Count}, {Group}, "Zildj", {Observation Date}, >= [From Date]@row, {Observation Date}, <= [To Date]@row )

    Should be:

    =SUMIFS(Count,Group,"Zildj",ObservationDate, > = [FromDate]@row,ObservatioDate, < =[ToDate]@row

    • {Count},ย {Group}, andย {Observation Date}ย are cross-sheet references to yourย Mainย sheet.
    • [From Date]@rowย andย [To Date]@rowย refer to theย current rowย in yourย Summaryย sheet where the formula is placed.
    • "Zildj"ย is the group you're filtering for. You can replace this with a cell reference likeย [Group]@rowย if you want it to be dynamic.
    • Make sure your cross-sheet references are correctly set up and named.
    • If you're using this formula in multiple rows (e.g., one per week), ensureย [From Date]ย andย [To Date]ย are columns in yourย Summaryย sheet that pull from theย Weekย sheet.

    Hope this helps.

  • JohnTriV
    JohnTriV โœญ

    Hey, thank you! The From and To Dates though are not on the reference sheet; it's on another one. I think I'm close, but still unparseable:

    SUMIFS({Count}, {Group}, "Zildj", {Observation Date}, >= [From Date]@row, {Observation Date}, <= [To Date]@row )

    The bold conditions are cross-referenced as well. I tried this:

    SUMIFS({Count}, {Group}, "Zildj", {Observation Date}, >= {From Date}@row, {Observation Date}, <= {To Date}@row )

    Where:

    Count, group and observation date are from Main

    From Date and To Date are from Week

    All these are going to be displayed in a Summary sheet.

  • Paul Newcome
    Paul Newcome Community Champion
    Answer โœ“

    @JohnTriV You need to put the week number on the Main sheet.

    =INDEX({Week Sheet Week Column}, MATCH(MAX(COLLECT({Week Sheet From Date Column}, {Week Sheet From Date Column}, @cell <= [Observation Date]@row)), {Week Sheet From Date Column}, 0))

    Then you would include this new column as a range/criteria set in your SUMIFS.

    =SUMIFS({Count}, {Group}, @cell = "Zildj", {New Week Column}, @cell = "Week 01")

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!