Collecting data for a week

Jennifer Parins
edited 06/15/22 in Formulas and Functions

I am attempting to use the SUMIFS formula to determine the number of employees trained in a month by week. I am also filtering by department and shift so there is a lot of factors. I tried to utilize the lesson on identifying days but not sure about what I have. This is what I tried, but it is not working:

The "Number Trained" column is what I want to have a total for pending the Shift, Department, Month and Week.

Any direction would be helpful.

Best Answer

  • Genevieve P.
    Genevieve P. Employee Admin
    Answer ✓

    Hi @Jennifer Parins

    Your structure looks good! However it looks like your last condition is what may be causing the problem.

    I see you have {Training Date} selected for the MONTH, which is good if that's a Date column. However you're searching for the text string "day: 1 2 3 4 5 6 7". This means that a cell would need to have that string in it (versus a date).

    If you're looking for the first 7 days of that month, I would actually suggest looking between a specific date range instead:

    {Training Date}, >= DATE(2022, 01, 01), {Training Date}, <= DATE(2022, 01, 07)


    To make this even easier, you could have two date columns in this sheet with the formula... one with the Start Date and one with the End Date of that week/month.

    {Training Date}, >= [Start Date]@row, {Training Date}, <= [End Date]@row

    This way you can make it a Column Formula and you won't have to adjust it every time there's a new date range.


    Full formula example:

    =SUMIFS({Number Trained}, {Shift}, "Shift 2", {Training Department}, Department@row, {Training Date}, >= [Start Date]@row, {Training Date}, <= [End Date]@row)


    Let me know if this works for you!

    Cheers,

    Genevieve

Answers

  • Genevieve P.
    Genevieve P. Employee Admin
    Answer ✓

    Hi @Jennifer Parins

    Your structure looks good! However it looks like your last condition is what may be causing the problem.

    I see you have {Training Date} selected for the MONTH, which is good if that's a Date column. However you're searching for the text string "day: 1 2 3 4 5 6 7". This means that a cell would need to have that string in it (versus a date).

    If you're looking for the first 7 days of that month, I would actually suggest looking between a specific date range instead:

    {Training Date}, >= DATE(2022, 01, 01), {Training Date}, <= DATE(2022, 01, 07)


    To make this even easier, you could have two date columns in this sheet with the formula... one with the Start Date and one with the End Date of that week/month.

    {Training Date}, >= [Start Date]@row, {Training Date}, <= [End Date]@row

    This way you can make it a Column Formula and you won't have to adjust it every time there's a new date range.


    Full formula example:

    =SUMIFS({Number Trained}, {Shift}, "Shift 2", {Training Department}, Department@row, {Training Date}, >= [Start Date]@row, {Training Date}, <= [End Date]@row)


    Let me know if this works for you!

    Cheers,

    Genevieve

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!