OFFSET Formula no longer working due to addition of row into worksheet

Marcie Be

Board Regular
Joined
Jun 25, 2020
Messages
124
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I had the following CF Formula

=OFFSET($U4,-MOD(ROW(U4),2),0)="Complete"

Problemis I have added a row to the worksheet.

Previously when U4 changed to complete it would fill green along with U5

Now that I have added a row above my original row 4, U4 is now U5 and U5 is now U6

I modified the formula to

=OFFSET($U5,-MOD(ROW(U5),1),0)="Complete"

But this only fills U5 green when it contains the word complete. U6 no longer fills green.

What further formula changes do I need to make?

@Eric W you had helped me with this previously, if you could help again that would be much appreciated.

Thanks in advance

Marcie
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi Marcie Be,

Looking at your formula you have
=OFFSET($U4,-MOD(ROW(U4),2),0)="Complete"
=OFFSET($U5,-MOD(ROW(U5),1),0)="Complete"

You would need to use
=OFFSET($U5,-MOD(ROW(U5),2),0)="Complete"


Try this and let me know how you go.
t0ny84
 
Upvote 0
t
Hi Marcie Be,

Looking at your formula you have
=OFFSET($U4,-MOD(ROW(U4),2),0)="Complete"
=OFFSET($U5,-MOD(ROW(U5),1),0)="Complete"

You would need to use
=OFFSET($U5,-MOD(ROW(U5),2),0)="Complete"


Try this and let me know how you go.
t0ny84
Thank you @t0ny84
=OFFSET($U5,-MOD(ROW(U5),2),0)="Complete"
produces
1598598017343.png
no CF happens

=OFFSET($U5,-MOD(ROW(U5),1),0)="Complete"

produces
1598598149032.png


I want to get back to this
1598598563454.png
how t use to work with =OFFSET($U4,-MOD(ROW(U4),2),0)="Complete" before I inserted a row above Row 4 making it Row 5.

Any other suggests? All welcome.
 
Upvote 0
Are you using =OFFSET($U4,-MOD(ROW(U4),2),0)="Complete" in your Conditional Formatting or is this in the cell itself?
 
Upvote 0
=OFFSET($U5,-MOD(ROW(U4),2),0)="Complete"
and applied to =$U$5:$U$6
1598601766431.png
 
Upvote 0
(y)
@t0ny84 Pefect!! You are a STAR!!
I always like to understand Why and not just because.
Any chance you can explain to me the logic? That way I get to learn.
Thanks again, much appreciated.
Marcie :)
I'm sorry I can't explain the logic because I myself don't understand the why with this one! Hopefully someone with more advanced skills can shed more light on the why.
 
Upvote 0
I'm sorry I can't explain the logic because I myself don't understand the why with this one! Hopefully someone with more advanced skills can shed more light on the why.
@t0ny84 Thanks again.
Excel formatting is tricky to get your head round sometimes, I know. Thanks again.
Regards
Marcie
 
Upvote 0
Here's the logic behind it. In row 5, ROW(U4) equals 4. The MOD function gives you the remainder when you divide by 2. 4/2 has no remainder, so that's 0. Then the OFFSET function starts at $U5, has a row offset of -0, so it resolves to U5, then it checks U5 to see if it says "Complete".

Now in row 6, the formula adapts to ROW(U5). 5 mod 2 = 1, so the OFFSET starts at $U6 this time, then applies the -1 row offset, to get back to the U5 cell to see if it says "Complete".

I'd actually recommend a different formula. Select U5:U6, click Conditional Formatting, and use this formula:

=$U$5="Complete"

With the absolute reference on the row, the formula won't change in the U6 cell. This also will continue to work if you add/delete rows above the formula. If you apply this to a larger range than 2 cells, we might need to go back to OFFSET, but see how that works.

Good luck!
 
Upvote 0

Forum statistics

Threads
1,215,005
Messages
6,122,661
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top