简体   繁体   中英

Conditional Formatting (If cell above and below is number, format only cell below)

I'am trying to create a conditional formatting which formats only cell below, but only if cell above and cell below both has number in them (negative or positive).

Now i got this:

=ISNUMBER(OFFSET(INDIRECT(ADDRESS(ROW(); COLUMN()));-1;0))

This formats the cell below if the cell above has a anything. It does not respect the condition where the cell below also must have a number.

Could somebody help me out here? I am realy stuck :)

EDIT:

So now i tried this:

=AND(ISNUMBER(INDIRECT(ADDRESS(ROW();COLUMN()))); ISNUMBER(OFFSET(INDIRECT(ADDRESS(ROW();COLUMN()));-1;0)))

But no luck whith this one either.

Just to clarify. This formula should run on $A$3:$BB$100

So for example if:

A5 = 10 (or any positive or negative number)

A6 = 10 (or any positive or negative number)

A6 should be formatet.

But if:

A5 = 10 (or any positive or negative number)

A6 = EMPTY

No formating should happen.

Hope this clarify what i'am trying to do :)

=AND(ISNUMBER(A5),ISNUMBER(A6)) This formula will also bypass formatting for A6 as well if both cells are empty. I assume that's what you want, as there's no value within either to format.

I see why we are getting different results with the formula. Conditional formatting is applied relative to the active cell when applied. Start with cell A2 as the first cell highlighted, (A2:A100),and then use this formula =AND(ISNUMBER(A2),ISNUMBER(A1)).Cell A2 should be the first active cell within the range of applied formatted cells.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM