determine if value is >=0.01 and <=0.05

soil doc 20 Reputation points
2026-05-27T15:01:11.9766667+00:00

the value on the sheet is in B4. This is what i have in the cell:

=IF(AND(B4>=0.01,>=0.05,"YES","NO")) I keep getting the error of is this a formula, then start with = or if not then '

It would be great if I could do as countif.

Alas, I miss Quattro! Thanks in advance.

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Answer accepted by question author
Hendrix-C 20,015 Reputation points Microsoft External Staff Moderator
2026-05-27T16:03:09.64+00:00

Hi @soil doc,

For your concern, your formula has two syntax issue:

  • The part AND(B4>=0.01, >=0.05, is missing the comparison subject, so Excel doesn't know what >= 0.05 is comparing against
  • The "YES", "NO" part is the outcome of IF formula so they should be outside the AND()

Therefore, the revised version of your formula would be

= IF(AND(B4>=0.01,B4<=0.05),"YES","NO")

If you want to do it with COUNTIF/COUNTIFS, there are different ways to do it depending on what you want to achieve:

  • For a single cell formula: =IF(COUNTIFS(B4, ">=0.01", B4, "<=0.05"), "YES", "NO")
  • For counting values between 0.01 and 0.05 in a range (e.g. B1:B20): =COUNTIFS(B1:B20, ">=0.01", B1:B20, "<=0.05")
  • If you want to return YES/NO if there is any matching value exists: =IF(COUNTIFS(B1:B20, ">=0.01", B1:B20, "<=0.05")>0,"YES","NO")

Hope my sharing may be helpful for your concern. If you have any questions or need any further clarification, please leave a comment here and I will be happy to continue to help you.  

Thank you for your patience and understanding. I'm looking forward to your reply. 


If the answer is helpful, please click "Accept Answer" and kindly upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Oldest
  1. soil doc 20 Reputation points
    2026-05-28T14:53:19.8966667+00:00

    Excellent! Accepted and working! And sorry for such an elementary question!

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.