# Check if a value is between two numbers in Excel

You can use the IF function to check if a value is between two values. You can also combine IF and AND functions in order to set multiple ranges.

This is the formula we are going to use in our example.

`=IF(A1>3,IF(A1<6,TRUE,FALSE),FALSE)`

This is how this formula works. It returns TRUE if the number is bigger than 3 and smaller than 6, otherwise, it returns FALSE. In our case, only two numbers: 4 and 5 meet this requirement. ### How this formula works

1. Checks whether the value is bigger than 3.
2. If the value is bigger, check if the value is smaller than 6.
3. If it’s smaller return TRUE, otherwise return FALSE.

## Check if a value is between using the AND function

In the previous example, we used two if functions, but we can write this formula in a different way. This time we are going to use one IF and one AND function.

This is how our formula looks like.

`=IF(AND(A1>3,A1<6),TRUE,FALSE)`

You can even make this code shorter by using only the AND function.

`=AND(A1>3,A1<6)`

This formula is much cleaner and more readable than the last one.

## Check if a value is between multiple ranges

So far, in both examples, we created formulas that check whether the value is between two number. Now, let’s try to create a formula that will check whether a value exists in more than one range.

We could create this formula using only the IF function, but it would be much too complicated, that’s why we are going to use both IF and AND functions, as we did in the previous example.

This is the formula.

`=IF(AND(A1>3,A1<6),TRUE,AND(A1>7,A1<10))`

And this is the result. The numbers that meet this condition are 4, 5, 8, 9. And this is what we can see inside the worksheet.

### How this formula works

1. Checks whether the value is bigger than 3 and smaller than 6. If the value meets this criterion it returns TRUE.
2. If the value is not present in the first range, check it for the second range.
3. If it’s not present in any of these ranges return FALSE.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8875374,"math_prob":0.9943666,"size":1937,"snap":"2020-45-2020-50","text_gpt3_token_len":487,"char_repetition_ratio":0.15312985,"word_repetition_ratio":0.08522727,"special_character_ratio":0.24935468,"punctuation_ratio":0.12528473,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99925256,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,4,null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-25T04:31:26Z\",\"WARC-Record-ID\":\"<urn:uuid:910e14db-56bb-4ee1-8627-99110409de6d>\",\"Content-Length\":\"46952\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d3c2af2d-5b14-4bc3-a378-7d1afb6a2ceb>\",\"WARC-Concurrent-To\":\"<urn:uuid:a57b08df-224a-474c-bd3f-1e952a1e76d0>\",\"WARC-IP-Address\":\"104.28.1.88\",\"WARC-Target-URI\":\"https://excel.officetuts.net/en/formulas/check-if-a-value-is-between-two-numbers\",\"WARC-Payload-Digest\":\"sha1:JTTLRLFUYWUBLMPOPGC67IHDVXJZRX64\",\"WARC-Block-Digest\":\"sha1:LUDK3BOGWIUL6QX6QMP7ZQNE5O6KPMKN\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141181179.12_warc_CC-MAIN-20201125041943-20201125071943-00651.warc.gz\"}"}