I am using a spreadsheet based on the "Employee Absence schedule" template. Sample attached.
I want to highlight, to make obvious to the user, when three consecutive absences occur.
That is, when the letter a is entered into three consecutive cells in one row.
I am using a conditional formula, "use a formula to determine which cells to format" & a format of black bold text on a yellow fill
[note: the sample has other conditions already built into the template]
I did try counting to either side only hoping that as each cell would have the same formula it owuld logically work. It did not. So now I have this:
In cell b4. counting 2 cells ahead.
=COUNTIF(B4:D4,"=a")>2
in c4, counting either side, and two ahead.
=COUNTIF(B4:D4,"=a")>2
=COUNTIF(c4:e4,"=a")>2
in d4, counting either side, and two ahead & two behind.
=COUNTIF(B4:D4,"=a")>2
=COUNTIF(c4:e4,"=a")>2
=COUNTIF(d4:f4,"=a")>2
In each case, where a, a, a, occurs a yellow fill and a bold text "a" should result.
BUT, I can only get a fill and bold on the FIRST cell in a sequence of three, AND I can't copy/paste/autofill the conditions across the entire row with the criteria changing (incrementing) automatically. As I want to put these conditions on each of 30 cells, and maybe 46 rows editing each is rediculous.
I suspect a VBA may be needed but I can't write one. OR perhaps someone knows a better way to do it.
Advice very welcome and thank you.
Mike S.
Sorry but the browse on the "upload a file" button can not see my Excel files. odd?
I want to highlight, to make obvious to the user, when three consecutive absences occur.
That is, when the letter a is entered into three consecutive cells in one row.
I am using a conditional formula, "use a formula to determine which cells to format" & a format of black bold text on a yellow fill
[note: the sample has other conditions already built into the template]
I did try counting to either side only hoping that as each cell would have the same formula it owuld logically work. It did not. So now I have this:
In cell b4. counting 2 cells ahead.
=COUNTIF(B4:D4,"=a")>2
in c4, counting either side, and two ahead.
=COUNTIF(B4:D4,"=a")>2
=COUNTIF(c4:e4,"=a")>2
in d4, counting either side, and two ahead & two behind.
=COUNTIF(B4:D4,"=a")>2
=COUNTIF(c4:e4,"=a")>2
=COUNTIF(d4:f4,"=a")>2
In each case, where a, a, a, occurs a yellow fill and a bold text "a" should result.
BUT, I can only get a fill and bold on the FIRST cell in a sequence of three, AND I can't copy/paste/autofill the conditions across the entire row with the criteria changing (incrementing) automatically. As I want to put these conditions on each of 30 cells, and maybe 46 rows editing each is rediculous.
I suspect a VBA may be needed but I can't write one. OR perhaps someone knows a better way to do it.
Advice very welcome and thank you.
Mike S.
Sorry but the browse on the "upload a file" button can not see my Excel files. odd?