Conditional formating Question

sujirpinna

New Member
Joined
Dec 1, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello - I want to apply a rule , that will set a top border and a bottom border for the 1st instance of date and the last instance of the same date respectively .

Pls refer to the before image (without borders) and after image (with border applied to the top most and the bottom most row for each date).

My date will always be sorted in descending order of date .

Pls help with this conditional formatting of applying borders as i do not have a solution.

Thank you for time and interest in solving my problem.
 

Attachments

  • Before.jpg
    Before.jpg
    68.3 KB · Views: 7
  • After.jpg
    After.jpg
    81.2 KB · Views: 7

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Select your data range and try these CF rules, and change the ranges to suit your data:

Book1
A
111/29/2023
211/29/2023
311/29/2023
411/22/2023
511/15/2023
611/15/2023
711/8/2023
811/8/2023
911/8/2023
Sheet5
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A9Expression=COUNTIF($A$1:$A1,A1)=COUNTIF($A$1:$A$1000,A1)textNO
A1:A9Expression=COUNTIF($A$1:$A1,A1)=1textNO
 
Upvote 1
Hello ,
Thanks for your quick response . This bordering logic should be applied to the entire table , based on the dates in 4th column . Here is what i observed and need your further help please .

1) When i applying this formatting only for the 4th column it is giving the result that i want . (one small thing is that the Top border for the First row is not appearing. ie 29th November is only having a bottom border)

2) When i select the entire table for the "Applies To" section of conditional formating (A15:E33) then i am getting a different result . The 4th column is accurate , but for all other columns Top and Bottom borders are being applied to each and every line.

I hope i am clear in conveying . kindly check the attached screenshot and hopefully it is a quick fix.
 

Attachments

  • After CF.jpg
    After CF.jpg
    52.4 KB · Views: 5
Upvote 0
Ideally please provide and XL2BB sample of your data so whoever helps you doesn't manually have to create sample data to work on.
It also gives the row, column and sheet references used in your data which means you have to spend less time interpreting and re-engineering the solution to fit your data.
If you have to give a picture please include the row and column information in the picture.

The main change to @dreid1011 solution would be to place a "$" in front of the A1 used in the criteria.
Assuming row 14 has the table headings in it, here is dreid's solution customised.

20231202 Conditional Formatting Borders sujirpinna.xlsx
ABCDE
14Col1Col2Col3Col4Col5
1529/11/2023
1629/11/2023
1729/11/2023
1829/11/2023
1930/11/2023
201/12/2023
211/12/2023
221/12/2023
231/12/2023
243/12/2023
253/12/2023
263/12/2023
2710/12/2023
2815/12/2023
2915/12/2023
3015/12/2023
3115/12/2023
3215/12/2023
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A15:E32Expression=COUNTIF($D$15:$D15,$D15)=1textNO
A15:E32Expression=COUNTIF($D$15:$D15,$D15)=COUNTIF($D$15:$D$33,$D15)textNO
 
Upvote 0
Another option?
Book1
ABCDEFG
1HDR1HDR2HDR3HDR4HDR5HDR6HDR7
22-Dec-23
32-Dec-23
42-Dec-23
53-Dec-23
64-Dec-23
74-Dec-23
84-Dec-23
94-Dec-23
105-Dec-23
116-Dec-23
12
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:G11Expression=$E2<>$E3textYES
A2:G11Expression=$E2<>$E1textYES
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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