Using Countif and And together?

Options

I am looking for some help on this one.

I need to be able to find duplicates but only under specific conditions. For example, I have a list of SKUs as one column, and a second of the order status of that item. I need to know when multiple of the same SKU are in the same step of the process. So, instead of using =COUNTIFS($[SKU]:$[SKU], [SKU]) to count the duplicates of the same SKU, I need to add something in there so that it counts duplicate SKUs but ONLY if the Process column says "processing " for example. 

Thanks,

Brett

Comments

  • L_123
    L_123 ✭✭✭✭✭✭
    Options

    I don't see enough info for me to actually build you a formula, but what you want is 

     

    =count(collect([insert info here]))

     

    Use collect to return a list of values that match your criteria then use count to find how many match. 

    Pay attention to the input format of collect as it is a little weird. 

    collect(row to return values from, row to check, criteria to check, row to check, criteria to check)

     

    https://help.smartsheet.com/function/collect

     

  • Brett Mathison
    edited 04/23/18
    Options

    Hey Luke,

    Thank you for the response. I have provided a screen shot for a rough example, to maybe get a better idea of the formula.

    Thanks for your help,

    Brett 

    SmartsheetExample.PNG

  • L_123
    L_123 ✭✭✭✭✭✭
    Options

    Alright I misunderstood. You don't need the collect then.

     

    =COUNTIFS(SKU:SKU, SKU@row, Status:Status, Status@row)

  • ddietz
    Options

    Brett~

    There is a much cleaner way of doing this by creating a new sheet with all your SKU's listed and then referencing the original sheet to get a count.  Then, you would be able to run reports easily, or just look at the SKU summary to see a quick count of all pending orders.

    What you're requesting would not be ideal as it will have the same count on every line of your sheet, making reporting on the sheet a nightmare.

    I added a snip to show you a very simple SKU summary page.

    Hope this helps!

    ddietz

    Summary Snip

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!