# Countif Help!

#### Calix21

##### New Member
Would appreciate you could help me sort this out. I am a beginner in excel.

I have this following data:

b1=10 c1=8 d1=2 e1=5
b2=m c2=m d2=x e2=m f2=23

how to add the course hours number only if there is an m on a cell?

Thank you!

Last edited:

### Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

#### VBA Geek

##### MrExcel MVP
<b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">F4</th><td style="text-align:left">=SUMIFS(<font color="Blue">B1:E1,B2:E2,"m"</font>)</td></tr></tbody></table></td></tr></table><br />

#### Calix21

##### New Member
That worked! Thank you very much!!!
how about if i need the cell with "m" and "mx"?

Thanks!

##### MrExcel MVP
That worked! Thank you very much!!!
how about if i need the cell with "m" and "mx"?

Thanks!

Try...

=SUM(SUMIFS(B1:E1,B2:E2,{"m","mx"}))

Replies
3
Views
32
Replies
3
Views
106
Replies
31
Views
1K
Replies
13
Views
107
Replies
1
Views
73