Discussion Re: Conditional Formatting on Concatenate Formula in Excel
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2478771#M104414
<P><LI-USER uid="972444"></LI-USER> I created 1 conditional formatting formula you can use as a template:</P><LI-CODE lang="excel">=VLOOKUP(IFS(LEFT(I$2,3)="W/E",I1&J1,LEFT(H$2,3)="W/E",H1&I1,1,""),Legend!$B$2:$C$38,2,FALSE)="AG"</LI-CODE><P>This was applied to the entire region I:BD and should work as long as the pair of columns you want it applied to are the only columns that start with "W/E".</P><P> </P>Wed, 23 Jun 2021 22:28:13 GMTmtarler2021-06-23T22:28:13ZConditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2474262#M104292
<P>Hi Team, I have successfully created a conditional formatting concatenate formula, however when the columns are copied and new ones are inserted, the conditional formatting cells are using the old columns and not basing them on the new columns.</P><P> </P><P>For example: I copy columns AY and AZ into BB and BC, however the formula is picking up AY and AZ still.</P><P> </P><P>I have attempted to resolve this issue numerous times, however I have had no luck. Please find print screens attached. </P><P> </P><P>=VLOOKUP(CONCATENATE($BB3,$BC3),Legend!$G$2:$H$38,2,FALSE)="Blank"</P><P>=VLOOKUP(CONCATENATE($BB3,$BC3),Legend!$G$2:$H$38,2,FALSE)="R"</P><P>=VLOOKUP(CONCATENATE($BB3,$BC3),Legend!$G$2:$H$38,2,FALSE)="AR"</P><P>=VLOOKUP(CONCATENATE($BB3,$BC3),Legend!$G$2:$H$38,2,FALSE)="A"</P><P>=VLOOKUP(CONCATENATE($BB3,$BC3),Legend!$G$2:$H$38,2,FALSE)="AG"</P><P>=VLOOKUP(CONCATENATE($BB3,$BC3),Legend!$G$2:$H$38,2,FALSE)="G"</P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="milo1234_0-1624439093585.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/290622i0ABA3B9ED6424A27/image-size/medium?v=v2&px=400" role="button" title="milo1234_0-1624439093585.png" alt="milo1234_0-1624439093585.png" /></span></P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="milo1234_1-1624439101251.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/290623iCF1F44768E1BF81C/image-size/medium?v=v2&px=400" role="button" title="milo1234_1-1624439101251.png" alt="milo1234_1-1624439101251.png" /></span></P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="milo1234_2-1624439107441.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/290624i10CF16CC52B0D6E9/image-size/medium?v=v2&px=400" role="button" title="milo1234_2-1624439107441.png" alt="milo1234_2-1624439107441.png" /></span></P><P> </P><P> </P>Wed, 23 Jun 2021 09:06:29 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2474262#M104292milo12342021-06-23T09:06:29ZRe: Conditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2475017#M104309
Hi, I'm a little confused about the issue. You say, "I copy columns AY and AZ into BB and BC, however the formula is picking up AY and AZ still." but then the formula you give is "=VLOOKUP(CONCATENATE($BB3,$BC3),Legend!$G$2:$H$38,2,FALSE)="Blank""<BR />That said, I think you problem is the $ in the Concatenate formula. On one hand you are using it to force both columns to concatenate the correct cells but then when you copy to new columns it is preventing it from looking at and acting on the new columns.<BR />IF you have blank columns to the left and right of each set as you show above you could make the formula:<BR />=VLOOKUP(CONCATENATE(BA3:BC3),Legend!$G$2:$H$38,2,FALSE)="Blank"<BR /><BR />So in this solution cell BB3 would apply the above formula and concatenate BA3:BC3 which would be blank & BB3 & BC3 and give what you want. Then BC3 would concatenate the offset/relative cells BB3:BD3, but again assuming those blank columns would be BB3 & BC3 & blank and again give you what you want. Of course this ONLY works if there are blank columns on both sides.<BR />There are other tricks you can play if you know that the columns of interest are always a fixed amount apart (e.g. columns 10,11 and 20,21 and 30,31 ....) and then you can use the column value to offset the cell and make sure it concatenates the correct set. So in the below formula if the column is divisible by 10 then concatenate (I just use the & operator) the next cell but if not then use the previous cell:<BR />=VLOOKUP(BB3&OFFSET(BB3,0,IF(MOD(COLUMN(BB3),10),-1,1)),Legend!$G$2:$H$38,2,FALSE)="Blank"<BR /><BR />Another trick could be to use the column header to do the offset. For example it looks like the column header of the 1st column in each pair is "W/E". so the following might work:<BR />=VLOOKUP(BB3&OFFSET(BB3,0,IF(BB$1="W/E",1,-1)),Legend!$G$2:$H$38,2,FALSE)="Blank"<BR /><BR />I hope that helpsWed, 23 Jun 2021 12:26:55 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2475017#M104309mtarler2021-06-23T12:26:55ZRe: Conditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2475303#M104319
<P><LI-USER uid="570951"></LI-USER> Thank you for your suggestions, however they have not resolved the issue. </P><P> </P><P>The formula I provided showed cells AY and AZ, as I amended this formula, however they originally showed BB and BC when copied and inserted. </P><P> </P><P>The columns either side will not be blank, these are always filled with text however I removed this as they contained sensitive data. </P><P> </P><P>I have attached sample data - please could you have a go and see if you can resolve? </P><P> </P><P>Thank you for your help. </P><P> </P><P> </P>Wed, 23 Jun 2021 14:04:56 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2475303#M104319milo12342021-06-23T14:04:56ZRe: Conditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2478771#M104414
<P><LI-USER uid="972444"></LI-USER> I created 1 conditional formatting formula you can use as a template:</P><LI-CODE lang="excel">=VLOOKUP(IFS(LEFT(I$2,3)="W/E",I1&J1,LEFT(H$2,3)="W/E",H1&I1,1,""),Legend!$B$2:$C$38,2,FALSE)="AG"</LI-CODE><P>This was applied to the entire region I:BD and should work as long as the pair of columns you want it applied to are the only columns that start with "W/E".</P><P> </P>Wed, 23 Jun 2021 22:28:13 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2478771#M104414mtarler2021-06-23T22:28:13ZRe: Conditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2479857#M104447
<P><LI-USER uid="570951"></LI-USER> Thank you for this. I have applied the formula to all relevant columns with the correct colour coding. It seems to work for most of the cells, however in the sample data attached, if I change a cell to F1 and T1 this should be green together, however one cell shows (F1) as green and the other cell as red (T1). </P><P> </P><P>Also when I copy the 3 columns and insert these copied cells for a new week, the cells that the conditional formatting applies to, changes. </P><P> </P><P>Please can you help? </P>Thu, 24 Jun 2021 08:54:12 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2479857#M104447milo12342021-06-24T08:54:12ZRe: Conditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2480459#M104476
<P><LI-USER uid="972444"></LI-USER> there was a typo in one of the formulas that references row E instead of H. I fixed that so I hope the attached works for you.</P><P>As for copy and paste, yes it will "change" the applied to and the formula but that should be ok. What it is doing is COPYING both the applied to range and formula and shifting the cell references according to the new location. You can see that if under conditional formatting you use the drop-down at the top and set it to "This Worksheet" and you will see 'duplicate rules'. And after a bit of copy, paste, insert, and such that conditional formatting drives my OCD crazy and I have to 'clean it up' but that is cosmetic and not functional issues. </P>Thu, 24 Jun 2021 12:31:05 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2480459#M104476mtarler2021-06-24T12:31:05ZRe: Conditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2480760#M104481
<P><LI-USER uid="570951"></LI-USER> Thank you again, this is really useful. </P><P>I can see you resolved the formula, however when you copy columns BH, BI & BJ for a new week and insert the copied cells, the same issue applies. </P><P> </P><P>T1 and F1 does not change to green together - what can I do to stop this? </P>Thu, 24 Jun 2021 13:43:10 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2480760#M104481milo12342021-06-24T13:43:10ZRe: Conditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2480900#M104487
the easiest is to not "insert copied cells", just PASTE. If you need to insert columns then do that 1st then copy and paste. That is interesting what "insert copied cells" does, not sure if that is a bug or not and might be useful trick in certain cases.<BR />Thu, 24 Jun 2021 14:15:54 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2480900#M104487mtarler2021-06-24T14:15:54ZRe: Conditional Formatting on Concatenate Formula
https://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2480957#M104488
<P><LI-USER uid="570951"></LI-USER> Thank you so much for helping, I really appreciate it <LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"></LI-EMOJI></P>Thu, 24 Jun 2021 14:23:49 GMThttps://techcommunity.microsoft.com/t5/excel/conditional-formatting-on-concatenate-formula/m-p/2480957#M104488milo12342021-06-24T14:23:49Z