The below is a simple SumIf
calculation where I want to sumif >=
the variable k
that is declared as a Double
.
This, however returns 0. If I change k
for any integer, 3, 4 etc, it returns the true
value. But if I change k
for 4.23983
it returns 0
.
I already tried to declare another Double
variable (lets say a
) and put a = sumif(...)
. But that gives me 0
as well. I also tried "">="& k &"""
but that doesn't work either (found that on Google).
Worksheets("ES").Cells(j + 10, 6).Value = Application.WorksheetFunction.SumIf(Worksheets("help").Range("A1:A4273"), ">=" & k, Worksheets("help").Range("A1:A4273"))
Last edit. Based on comments, circumstances require conversion from European format to US for calculations. Please refer to this post for bulk of code used: VBA - Evaluate Conditions as String
Here's a function that can be added to a module and used freely in the worksheet:
Use as follows: