COUNTIF number of occurrences of numerical value < threshold

Hello

I am trying to count number of times a number - in a text format - is below a given threshold. It happens that is the range, there are non-numerical values as in below example

- In B1, the formula "=--(VALUE(A1:A4))" is to convert A1:A4 into numerical value, shown in Excel as { 10, 20, #VALUE!, 30 }

- In C1, the formula "=--(B1:B4)<30" is to an array of boolean, here { TRUE, TRUE, #VALUE!, FALSE }

- In E1, the formula "=COUNTIF(C1#;TRUE)" gives the result 2

The issue I have is that I don't know how to combine formulas of B1, B2 and E1 in a single formula... Any idea?

ABCEF
110=--(VALUE(A1:A4))=--(B1:B4)<30=COUNTIF(C1#;TRUE)
220
3A
430

Thanks a lot for your help,

stchln

Hello Stchln, hello forum,

Did you know that google has a tool called "Google translator"?

Example:

Bonjour Stchln, bonjour le forum,

Sais-tu que google possède un outil nommé "Google traducteur" ?

Hi stchin, salut ThauThème

Ne soyons pas chauvin

In French the formula is :

=SOMMEPROD(ESTNUM(CNUM(A1:A4))*1)

In English may be

=SUMPRODUCT(ISNUMBER(VALUE(A1:A4))*1)

@+

Hi BrunoM45

Thanks for your response. This sounds promising but not yet what I need. I think we need also a test vs the threshold 30

stchln

Re,

With custom function In VBA

Function CountNumberText(Rng As Range, Max As Integer)
  Dim Cel As Range, Ind As Integer
  ' Execute every time
  Application.Volatile
  ' Initialise
  Ind = 0
  '
  For Each Cel In Rng
    If IsNumeric(Cel) And Val(Cel) < Max Then
      Ind = Ind + 1
    End If
  Next Cel
  ' Return result
  CountNumberText = Ind
End Function

To Call

=CountNumberText(A1:A4;30)

@+

merci beaucoup BrunoM45, je vais donc me résoudre à faire du VBA, à copier ce que vous avez bien voulu partager. Encore Merci

stchln

sinon, pour partager, inspiré par vous, j’ai trouvé une possibilité ci-dessous

={SUMPRODUCT(--IFERROR(VALUE(A1:A4)<30;0))}

In French

={SOMMEPROD(--SIERREUR(CNUM(A1:A4)<30;0))}

stchln

Re,

Pour moi, le résultat n'est pas correcte

Retourne 1 pour l'exemple alors que ce devrait être 2

@+

bizarre, ça fonctionne pour moi

voir fichier attaché, formule en E1 "=SUMPRODUCT(--IFERROR(VALUE(A1:A4)<30;0))"

4book1.xlsx (10.53 Ko)

Bonjour stchIn

je comprends mieux,
Tu n'as pas indiqué la formule correctement, c'est un produit matriciel entouré d'accolade

C'est corrigé

ok, merci encore pour l’aide

Rechercher des sujets similaires à "countif number occurrences numerical value threshold"