- C column is sorted from the input data
- From the sorted output, the selected range should be with in -0.25 to 0.25
How to add more than one criteria in COUNTIF function or its similar function?
Original syntax:
.Resize(Application.CountIf(.Cells, "<0")).Select
Requirement:
.Resize(Application.CountIf(.Cells, ">-0.25 & <0.25")).Select
CodePudding user response:
Replace CountIf
with CountIfs
when you want more than one condition. Try this:
.Resize(Application.WorksheetFunction.CountIfs(.Cells, ">-0.25", .Cells, "<0.25")).Select