Fix COUNTIF for Text DATEDIF Tenure Results in WPS Spreadsheets
Question details
Make COUNTIF recognize customer tenure values calculated with DATEDIF when results such as 3.8 are stored as text.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- The user calculates tenure from customer start dates and needs to count results that meet numeric conditions.
- Observed behavior
- COUNTIF does not evaluate tenure values correctly because the calculated decimal-style result is text rather than a numeric value.
Check one tenure result with a numeric test such as `=ISNUMBER(A2)`, replacing A2 with the tenure cell. Confirm that the start-date cell, such as V16, contains a valid spreadsheet date rather than text.
Convert the DATEDIF tenure result to a number with VALUE
Use this method when your formula joins years and months into a result such as 3.8 and COUNTIF cannot match numeric criteria.
Concatenating values with `&` creates text. Wrapping the combined result in VALUE converts the text back into a number that COUNTIF can compare against numeric criteria.
Select the cell containing the DATEDIF tenure formula, then click the formula bar or press F2 to edit it.
Change the final expression from `ys&"."&ms` to `VALUE(ys&"."&ms)`. For example, use `=VALUE(ys&"."&ms)` where `ys` is the year result and `ms` is the month result.
Press Enter, then drag the fill handle from the selected cell down the column to update the remaining customer tenure values.
In a result cell, enter a numeric COUNTIF formula such as `=COUNTIF(A2:A100,">=3")`, replacing A2:A100 with the numeric tenure range.

Calculate approximate decimal years directly from the start date
Use this simpler alternative when an approximate tenure in years is sufficient and you do not need a years-and-months display value.
Convert Text-Based Tenure Calculations for Accurate COUNTIF Results
WPS Spreadsheets lets you edit DATEDIF-based formulas, convert concatenated text with VALUE, and use COUNTIF to count customer tenure ranges accurately.
- 1. Open the customer workbook: Open the spreadsheet in WPS Office and select the worksheet containing the start dates and tenure calculations.
- 2. Select the tenure formula cell: Click the first tenure result cell, then use the formula bar or press F2 to review the DATEDIF formula.
- 3. Convert the combined value: Wrap the concatenated years-and-months expression with `VALUE(...)`, such as `VALUE(ys&"."&ms)`.
- 4. Fill the corrected formula down: Press Enter and drag the fill handle down to apply the numeric formula to all customer rows.
- 5. Create the COUNTIF calculation: Select an output cell and enter COUNTIF with a numeric criterion, such as `=COUNTIF(A2:A100,">=3")`.

Frequently Asked Questions
Why does COUNTIF ignore a value that looks like 3.8?
The value may be stored as text because a formula joined components with `&`. COUNTIF numeric criteria such as `">=3"` require numeric cell values. Use `VALUE(ys&"."&ms)` to convert the result.
How can I check whether a DATEDIF tenure result is a number?
In an empty cell, enter `=ISNUMBER(A2)` and replace A2 with the tenure result cell. TRUE means the value is numeric; FALSE means it is text or another nonnumeric value.
What COUNTIF formula counts customers with at least three years of tenure?
If the numeric tenure values are in A2:A100, use `=COUNTIF(A2:A100,">=3")`. Ensure the tenure cells are numbers before using the formula.
Can I use TODAY with a customer start date instead of combining DATEDIF results?
Yes. Enter `=(TODAY()-V16)/365`, replacing V16 with the start-date cell. This produces an approximate numeric year value that works directly with COUNTIF.
Does changing the cell format from Text to Number fix the formula result?
Not always. If the formula itself concatenates values with `&`, it still returns text. Update the formula with VALUE, then format the cell through Home > Number Format if needed.




