Originally Posted by
USFishin
Is there any way to automate this?
Yes, conditional formatting is the way to go. It can be tricky when the rules are so complex, but there are a couple of techniques you can use to solve this problem. First trick is to break the problem down into parts and the second trick is to solve the problem in the spreadsheet first, then create the conditional format last. I have attached my worksheet for you to follow.
1. determine if the current line should have the bottom border removed based on the BRKR column on the same line. Anything with a "P" meets this criteria. See formula in column V.
2. determine if the current line should have the bottom border removed based on the BRKR column on the line above. only a 3P meets this criteria. See formula in column W.
3. determine if the current line should have a bottom border considering the 2 rules above. See formula in column X.
4. Create one super formula that gives the answer without needing columns V,W,X. See forumula in column Y.
Now just copy the formual from cell Y12, highlight range Q12:T32 and apply a conditional format. Select the option "use a formula to determine which cells to format" and paste your formula. Then set the format to remove the bottom border.
Note: it is important when you do this last step that you are careful and aware of the "active cell" in the highlighted range. In this case, the active cell is Q12 (you will see it is a different colour than the other highlighted cells. The formula you paste into the conditional formatting box will be referenced to this cell, so the formula must take that into account. It will be then copied to every other hightlighted cell using normal Excel copy rules, which is why the $ is required to make sure that the formula always refers to the BRKR column L.
For the record, this is the formula (also known as a mega formula).
They are impossible to understand, but that is not needed because you built the formula from the bottom up as described above. It is a good idea to keep the working columns (V:Y) hidden so that if you have any problems, you can go back and sort it out.
EDIT: after I had finished, I realised that I could have made the formula in column W simpler. I will leave that for you to do for practice :-)
Bookmarks