COUNT IF - CRITERIA

Options

Hello Team,

I have the following data to work on:

22-123
22-456
22-789
23-123
23-456
23-789
24-123
24-456
24-789

Where the first 22-, 23- and 24- represent 2022, 2023, 2024.

I'm trying to use the "COUNTIF" formula to count them by using, the 22, 23 and 24 as criteria, to know how many items I have per year, however it shows me 0.

How should I enter the formula to count them correctly?

Thanks in advance!

Tags:

Answers

  • Will Jeffords
    Will Jeffords Overachievers

    Hi @DG 13 , try this formula where your data is entered into a column called "Year Val":

    =COUNTIF([Year Val]:[Year Val], LEFT(@cell, 2) = 22)

    Let me know if further help needed!

    Best,

    Will

    Will Jeffords

    Workflow Wayfinder™
    Biz Ops Leader | Smartsheet Overachiever | Community Hype-man
    follow me on LinkedIn for more community love and workflow-workshow

  • DG 13
    DG 13 ✭✭

    Hi @Will Jeffords , Thanks for tackling my question, the colum where I have the data is "Coded Name".

    I entered your suggested formula this way: =COUNTIF([Coded Name]:[Coded Name], LEFT([Coded Name], 2) = 22) But did not work.

    Any other suggestion?

  • Will Jeffords
    Will Jeffords Overachievers
    edited 05/18/24

    hi @DG 13 the second half needs to be exactly “LEFT(@cell, 2) =22)”

    Try that instead of “LEFT(Coded Name…”

    Let me know if fixes!

    Best

    Will

    Will Jeffords

    Workflow Wayfinder™
    Biz Ops Leader | Smartsheet Overachiever | Community Hype-man
    follow me on LinkedIn for more community love and workflow-workshow

  • DG 13
    DG 13 ✭✭

    Hi @Will Jeffords!

    It brought the #UNPARSEABLE error.

    I changed it, I put it this way now =COUNTIF([Coded Name]:[Coded Name], LEFT(@cell, 2) =22)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!