SOLVED

Excel- SUM function not working with =IF(COUNTIFS function

Copper Contributor

Hi I am trying to find the Sum of a column that has given me the output of either 0 or 1 using the formula =IF(COUNTIFS(B22:W22,"np")*1,"1","0")- I have attached the Excel spreadsheet

 

Many Thanks

 

James

3 Replies

@James09 , use numbers, not texts

=IF(COUNTIFS(B4:W4,"np"),1,0)
best response confirmed by James09 (Copper Contributor)
Solution

@James09 , or, as variant

=--(COUNTIFS(B4:W4,"np")>0)

double dash converts logical to number

 

@Sergei Baklan 

Fantastic,

Thank you Very Much I had no idea

 

James

1 best response

Accepted Solutions
best response confirmed by James09 (Copper Contributor)
Solution

@James09 , or, as variant

=--(COUNTIFS(B4:W4,"np")>0)

double dash converts logical to number

 

View solution in original post