IT Log

Record various IT issues and difficulties.

Using the IF function to return ‘pass’ if two cell values are within range, ‘fail’ otherwise, and leave blank if cells are empty.


To solve the problem of returning ‘pass’ when two cell values are within a specified range, ‘fail’ otherwise, and leaving it blank if either cell is empty, we can use Excel’s IF function with nested logical functions. Here’s how to approach it:

  1. Check for Empty Cells: Use the IF function combined with OR(ISBLANK(cell1), ISBLANK(cell2)) to determine if either of the two cells is empty. If so, return a blank value.

  2. Range Check: If neither cell is empty, use nested IF functions to check whether both cell values fall within the specified range (e.g., between 10 and 20). Use AND(cell >= lower_limit, cell <= upper_limit) for each cell to ensure they are within bounds.

  3. Return Result: If both cells meet the range criteria, return ‘pass’. Otherwise, return ‘fail’.

The final formula combines these checks:

This formula ensures that:
– If either cell is empty, the result is blank.
– If both cells are within the range, it returns ‘pass’.
– Otherwise, it returns ‘fail’.


, , , ,