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.

HELP!! Needing to subtract just one from this formula

I have this formula for a total count! I just need to subtract 1 from the formula

This is what I have and it is showing Unparseable

="2021-2022 Total Contracts: " + COUNTIFS([Start Date]:[Start Date], AND(@cell >= DATE (2021, 1, 1), @cell <= DATE(2022, 12, 31)))-1)

Best Answer

  • Community Champion
    Answer ✓

    You have a small error with your parentheses, this should fix it:

    ="2021-2022 Total Contracts: " + (COUNTIFS([Start Date]:[Start Date], AND(@cell >= DATE(2021, 1, 1), @cell <= DATE(2022, 12, 31)))-1)

    While this formula works fine and is completely relevant, you can also rewrite it to avoid using the AND statement since COUNTIFS is meant to be used with multiple conditions anyway. This should work as well:

    ="2021-2022 Total Contracts: " + (COUNTIFS([Start Date]:[Start Date], @cell >= DATE(2021, 1, 1), [Start Date]:[Start Date], @cell <= DATE(2022, 12, 31))-1)

    But, like I said, your original approach is fine…. just showing multiple options.

Answers

  • Community Champion
    Answer ✓

    You have a small error with your parentheses, this should fix it:

    ="2021-2022 Total Contracts: " + (COUNTIFS([Start Date]:[Start Date], AND(@cell >= DATE(2021, 1, 1), @cell <= DATE(2022, 12, 31)))-1)

    While this formula works fine and is completely relevant, you can also rewrite it to avoid using the AND statement since COUNTIFS is meant to be used with multiple conditions anyway. This should work as well:

    ="2021-2022 Total Contracts: " + (COUNTIFS([Start Date]:[Start Date], @cell >= DATE(2021, 1, 1), [Start Date]:[Start Date], @cell <= DATE(2022, 12, 31))-1)

    But, like I said, your original approach is fine…. just showing multiple options.

  • Thank you so much!

  • Hello again! Is it possible to Subtract -1 (like above) and remove any cell that has the word suspended ( it is in a different column)

    So basically if i have 10 start dates and wanted to subtract one (like above) it would be 9, however, I would like to remove any that say suspended (which would be 3 of them) so the count would be 6 start dates. (These are in a separate column)

    Thank you in advance

  • Community Champion

    @She18ee Absolutely! This should do it:

    ="2021-2022 Total Contracts: " + (COUNTIFS([Start Date]:[Start Date], @cell >= DATE(2021, 1, 1), [Start Date]:[Start Date], @cell <= DATE(2022, 12, 31), Status:Status, NOT(CONTAINS("suspended", @cell))) -1)

    This assumes the other column you mentioned is [Status], so you will need to modify that accordingly.

  • Thank you! You have been such a great help! Last thing

    I want to count the people but remove the suspended. This is what I have so far! What am I missing!

    ="***TOTAL COUNT: "+COUNT([Partner Name]7:[Partner Name]1000), Status:Status, NOT(CONTAINS("suspended", @cell)))

  • Community Champion

    I think I understand, please correct me if I am wrong.

    You can use a COUNTIFS here also, since you are looking at multiple conditions. You also need to ensure you are comparing the same rows, in your case, 7 - 1000. See if this is what you are looking for:

    ="***TOTAL COUNT: " + COUNTIFS([Partner Name]7:[Partner Name]1000, @cell <> "", Status7:Status1000, NOT(CONTAINS("suspended", @cell)))

  • You rock!

    Thank you so much for everything!

  • Community Champion

    Happy to help!

    👍

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions