*Articles/Excel101*

Excel training

First written: Feb-2024

last changed Mar-2024

last changed Mar-2024

## Adding a COUNTIF formula

Here we want to add a formula to count how many cells are set to `1`

and place this information into the total row cell `E22`

- As before, we could simply type in the formula into cell
`E22`

but this time we will use an assistant to see how this works. Click on`E22`

and then click on the*fx*button to the left of the Formula Bar input field at the top of the worksheet - This will show an
*Insert Function*popup - Type "COUNT" into the Search field, and click [Go]
- Select
`COUNTIF`

from the list of found functions in the list, then click [OK] - Click on the
*Range*input field - Then using the mouse left-button, click and hold on cell
`E21`

and drag up to`E2`

(tip, you may need/want to move the popup out the way while doing this) - You should now see
*Range*set to`E2:E21`

on the popup field - Enter
`1`

into the*Criteria*field - Click [OK]; and you should now see
`11`

in`E22`

and the Formula Bar reads`=COUNTIF(E2:E21,1)`

#### Advanced Note

You can also use the `COUNTIFS`

function to apply multiple conditions, e.g. `=COUNTIFS(E2:E21,1,B2:B21,"Alex")`

(resulting in 1 in this case); COUNTIFS can take any number of *range,value* pairs

*square*

*chevron_left*Step-9-add-a-conditional-formula

Step-11-utilising-binary-cells

*chevron_right*
## Comments

## New Comment