# I'm trying to create a summary field formula to count two different values in the same column.

Options

I'm trying to create a summary field formula to count two different values in the same column. getting 0, I have PIVOTE table created for PO/Buyer tracker, in the ROW column I have PO number, Year of Creation & Buyer Name, I want to calculate PO count per buyer per year

(eg. Year 2023 / PO Count "XX", For each buyer. screenshot attached pls advise

• ✭✭✭✭✭✭
Options

I have got this idea:

1- Create 2 helper columns : Buyer and Year with following column formulas:

Buyer `=IF(COUNT(ANCESTORS(ROW@row)) = 0, JOIN(CHILDREN(ROW@row)))`

Year `=VALUE(IF(COUNT(ANCESTORS(ROW@row)) = 0, RIGHT(JOIN(DESCENDANTS(ROW@row), "*"), LEN(JOIN(DESCENDANTS(ROW@row), "*")) - FIND("*", JOIN(DESCENDANTS(ROW@row), "*")))))`

2- Create summary fields in the Sheet Summary with following formulas:

#PO / Buyer 1 / 2023 `=COUNTIFS(Buyer:Buyer, "Buyer 1", Year:Year, 2023)`

#PO / Buyer 2 / 2024 `=COUNTIFS(Buyer:Buyer, "Buyer 2", Year:Year, 2024)`

Hope it works for you.

Gia Thinh Technology Co., LTD - Smartsheet Solution Partner.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!