Forum Discussion

Kjharris123's avatar
Kjharris123
Copper Contributor
Apr 06, 2022
Solved

Excel help

I was having an issue with a column of "if" statements in my spreadsheet.  I was wanting to get a total of true "if" statements for that week.  Each day of the week has =IF(F6<=TIME(12,0,0),"*","") to calculate if a person is coming back to work with less than 12 hours off.  If so the cell will leave a "*" indicating that you qualified for quick turnaround pay.  

 

I used =COUNTIF($G$3:$G$9,"*") for the column but I'm not getting the correct results.  That column has if statements with "*" to answer true for that individual cell.  The formula is counting the "*" in each of the if statements.  I need to count the "true" statements in the column not the "*" in the if statements???   

  • Kjharris123 The asterisk is seen as a wildcard character, so everything gets counted. Use "x" rather than "*" to mark and count the qualifying entries.

3 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Kjharris123 The asterisk is seen as a wildcard character, so everything gets counted. Use "x" rather than "*" to mark and count the qualifying entries.

  • If you want to count "true", the formula must be like that.
    =COUNTIF($G$3:$G$9,"true") or
    =COUNTIF($G$3:$G$9,True)

     

    If you want to count exact "*", the formula must be like that.
    =Sum(--($G$3:$G$9="*"))