Share via

Countif won't evaluate: it says "the cell currently being evaluated contains a constant"

Anonymous
2025-01-06T21:51:47+00:00

I am trying to count the number of occurrences of a set of numbers (representing survey answer numbers) in a range of numbers:

I've tried both =COUNTIF(G6:U6,"=1") and =COUNTIF(G6:U6,"=1").

The range is format number and contains numbers 1 through 4.

The cell just shows the formula and when I try to "Evaluate Formula" using the Formula Auditing tool, I can't step through it - it displays the message "the cell currently being evaluated contains a constant.

I played with it some more and it appears I had typed a blank before one of the numbers making it a text item. This I found out when I removed the formula I got one of those warning arrows to the right of the cell. "Number stored as text" - I chose "convert to number" and the formula now works.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. HansV 462.6K Reputation points MVP Volunteer Moderator
    2025-01-06T21:55:36+00:00

    I suspect that the cell containing the formula is formatted as Text. As a consequence, Excel treats that formula as a constant (literal) text string.

    Format the cell as General.

    Then press F2 and Enter.

    3 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2025-02-07T20:42:26+00:00

    Life saver!!! I've been beating my head of the desk today trying to figure out why this was happening.

    0 comments No comments