# Calc: Checking whether a range of cells are blank via a formula

asked 2012-04-01 01:06:18 +0200

Paul451
11 1 2 3
qubit
5721 3 48 41

I'm trying to create a formula that checks whether a range of cells above it are blank.

Ie, =IF(AND(E21>$C$16, $H$21:H22="");"Here!";"")

gives a #value error. Using F9 I found the error is $H$21:H22="". It works for a single cell, so I assume you can't check a range this way. So how do I do it?

Background: Simple physics spreadsheet. Each row increments a calculation, I want a flag to draw my attention to the spot where the calculation swings from negative to positive. Using =IF(E21>$C$16;"Here!";"") works, but then it has "Here!" on every positive row.
ie,
.
Here!
Here!
Here!
Here!

I would prefer to only have it appear once, on the first row it flips:
.
Here!
.
.
.

delete close retag edit

Sort by » oldest newest most voted

answered 2013-03-13 10:07:13 +0200

JohnSUN
2358 2 23 37
http://wmstrong.ru/

If you are interested in attracting attention only, then why not take advantage of the conditional formatting? Small demo - Flags to draw attention.ods

answered 2013-03-13 04:57:10 +0200

qubit
5721 3 48 41

Hi @Paul451,

Still looking for an answer here? Have you found an answer already?

answered 2012-04-01 02:18:50 +0200

mariosv
4719 20 46

Try this array formula:

=IF(($C$5<e10:e11)*isblank($h$10:h11);"here!";"")< p="">

Introduce with Ctrl+Shift+Enter, the AND() OR() don't work in array formulas.

Doesn't work with the range/array in isblank. =IF(ISBLANK(H10);"True";"False") shows True. =IF(ISBlank(H11);"True";"False") also shows true. But =IF(ISBLANK(H10:H11);"True";"False") shows False.

( 2012-04-01 05:46:19 +0200 )edit

IsBlank is not uspposed to work with a cell range. See http://docs.oasis-open.org/office/v1.2/cos01/OpenDocument-v1.2-cos01-part2.html#__RefHeading__1018370_715980110

( 2012-04-01 18:10:58 +0200 )edit

I didn't understand well what Paul451 want.

I hope the next array formula works as wanted.

=IF(($C$16<E21:E41)*($C$16>=E20:E40);"here!";"") (Ctrl+Shift+Enter)

Only shows here!, when the previous cell does not satisfy the condition.

( 2012-04-03 03:23:03 +0200 )edit

Mariosv, you can't test a range against a conditional (like >= ). You can't use a range with ISBLANK(). So H21="" returns TRUE. H20="" returns TRUE. Even (H20="")*(H21="") returns TRUE. But H20:H21="" returns #VALUE error. How do you test a range/array against another value?

( 2012-04-09 06:03:16 +0200 )edit

I can't be the first person in spreadsheet history to want to check all the cells in an array/range against a single value? There must be some way to do it.

( 2012-04-09 06:13:25 +0200 )edit

## Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

## Stats

Asked: 2012-04-01 01:06:18 +0200

Seen: 1,043 times

Last updated: Mar 13