count number of cells with a value in excel
Count cells until value changes with formula. Here is a simple formula can help you to quickly count the number of cells until value changes. Select a blank cell next to the values you want to count, enter this formula =COUNTIF(A$1:A1,A1) and drag auto fill handle over the cells needed this formula. See screenshot: Tip: in this formula, A1 is the cell you want to count, you can change it as you need.