Forum Discussion
clich216
Mar 27, 2023Copper Contributor
Iterating through columns and counting if a cell in that row contains A, B, or C and summing
Hello, I have a large range of cells that each have a list associated with them, such as Bag, Box, Cart, Tray. Another column in the range of cells has months associated with the rows. My goal t...
NikolinoDE
Mar 28, 2023Gold Contributor
You can use the COUNTIFS function to count how many of each option there is for a given month.
Here’s an example formula that counts how many times “Bag” appears in column A when the corresponding month in column B is “January”: =COUNTIFS(A:A,"Bag",B:B,"January").
As for BYROW(), it is used to apply a formula to each row of a range of cells.
You can use it with COUNTIF() to count how many times a value appears in each row of a range of cells. Here’s an example formula that counts how many times “Bag” appears in each row of a range of cells: =BYROW(A1:A10,LAMBDA(row,COUNTIF(row,"Bag"))).
I hope this helps!