Validate Comma Separated Numbers within Specific Range – Google Sheets

Have you ever wondered how to validate comma-separated numbers within a specific range in Google Sheets? Well, look no further! In this article, I will show you a simple yet effective way to accomplish this task. So let’s dive in!

Test Whether the Comma-Separated Numbers Are within a Specific Range in Google Sheets

Let’s say you have a list of numbers in cell A1, separated by commas, in a Google Spreadsheet. Before we proceed, make sure to format cell A1 as plain text to avoid any formatting issues. Now, let’s take a look at an example.

Imagine you have the marks of a student out of 100 in five subjects entered in cell A1 as follows: 90, 55, 45, 85, 99. The pass mark for all subjects is 50. Your goal is to test whether these marks fall within the range of 50-100.

To achieve this, enter the following combination formula in cell B1:

=if(countif(isbetween(split(A1,","),50,100),FALSE)=0,"PASSED","FAILED")

This formula will return either “PASSED” or “FAILED” based on whether the comma-separated numbers are within the specified range. In our case, the output will be “FAILED” since one of the subjects has a mark of 45, which is less than 50.

Now that you understand the formula, let’s move on to the data validation part.

Comma Separated Numbers within Specific Range – Data Validation

In data validation, we can use the Formula_1 mentioned earlier without the IF logical part. This will allow us to validate the comma-separated numbers within their specified ranges.

Additionally, you can use cell references instead of hard-coding the min and max values into the formula. This provides more flexibility, as you can easily change the min and max values without modifying the validation rule.

Here is an example to validate comma-separated numbers within a specific range in Google Sheets:

  1. Select Data > Data validation.
  2. Set the Cell range to A2:A5, which is the array containing the comma-separated numbers you want to validate.
  3. Choose Custom formula is as the Criteria.
  4. Enter the formula =countif(isbetween(split(A2,","),B2,C2),FALSE)=0 in the blank field.
  5. Select either “Show warning” or “Reject input”. In this example, we will select the former option.
  6. Finally, click Save.

The data validation will now check whether the comma-separated numbers in cells A2:A5 are within their specified ranges. If any numbers fall outside the range, a warning will be shown.

And there you have it! You now know how to validate comma-separated numbers within a specific range in Google Sheets using data validation. It’s a powerful technique that can save you time and ensure data accuracy.

If you want to learn more about Google Sheets and discover other useful tips and tricks, be sure to visit Crawlan.com. Happy validating!

Note: The article has been adapted and optimized for the brand Crawlan and the website Crawlan.com.

Related posts