Formatting cells filled by array formulae

Ludwig

Board Regular
Joined
Apr 7, 2003
Messages
97
Office Version
  1. 365
Platform
  1. Windows
I have a table where the first column is a date array that fills from a selected a start date to (in effect) the current month. Hence, each month the number of elements in the array extend down the rows.

From that column I then use array formulae to "spill down" calculated values based on each row's date for a number of fields.

What I would like to have is ALL the cell formatting "spill" down for each column as well. I've set the format of the column set so that numbers, [$.c] amounts, text etc are formatted as required for the entire column, but I cannot get cell formatting for borders etc to replicate downward. Means I have to manually format the cell borders as the array rows extend each month.
PS: I don't want to see this border formatting flow down beyond the end of the array row.​

My question:
  • Is there a way to get border formatting to occur for the rows with the array in it, but to *not* show below the 'table' of data.
  • Or do I just have to use conditional formatting to achieve it?
    e.g. conditional formatting borders etc based on something along these lines -
  • Excel Formula:
    AND( row( A1 ) > row( A$5 ) , row(A1) <= count( A$5# ) + row( A$5 ) )
Thanks for the help.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
There is no way for a formula to "change" a cell (in terms of adding borders, shading etc) so you will have to use conditional formatting or perhaps some event driven VBA code.
 
Upvote 0
I have a table where the first column is a date array that fills from a selected a start date to (in effect) the current month. Hence, each month the number of elements in the array extend down the rows.
I'm not exactly sure exactly what you mean by that but hopefully this example will suffice anyway. As you had intimated and @myall_blues has confirmed, Conditional Formatting is certainly one way to go & I think you can use simpler CF than your were suggesting.

If I am right that the first column populates with dates then I would consider doing it like this.
My example spills dates from the date in A2 up to the end of the current month & spills dummy formulas down the next 3 columns
Select the first row of what will be your spilling table (A5:D5 for me and apply the CF formula =$A5<>"" and set up the appropriate borders.
With that first row still selected: Conditional formatting -> Manage Rules.. and edit the 'Applies to' range to whatever will be bigger than your data will ever be (possibly say =$A$5:$D$5000) -> Apply -> OK

Here is my result

24 11 15.xlsm
ABCDE
1
225/10/2024
3
4
525/10/2024oddFFri
626/10/2024evenSSat
727/10/2024oddSSun
828/10/2024evenMMon
929/10/2024oddTTue
1030/10/2024evenWWed
1131/10/2024oddTThu
121/11/2024oddFFri
132/11/2024evenSSat
143/11/2024oddSSun
154/11/2024evenMMon
165/11/2024oddTTue
176/11/2024evenWWed
187/11/2024oddTThu
198/11/2024evenFFri
209/11/2024oddSSat
2110/11/2024evenSSun
2211/11/2024oddMMon
2312/11/2024evenTTue
2413/11/2024oddWWed
2514/11/2024evenTThu
2615/11/2024oddFFri
2716/11/2024evenSSat
2817/11/2024oddSSun
2918/11/2024evenMMon
3019/11/2024oddTTue
3120/11/2024evenWWed
3221/11/2024oddTThu
3322/11/2024evenFFri
3423/11/2024oddSSat
3524/11/2024evenSSun
3625/11/2024oddMMon
3726/11/2024evenTTue
3827/11/2024oddWWed
3928/11/2024evenTThu
4029/11/2024oddFFri
4130/11/2024evenSSat
42
43
44
CF Spill
Cell Formulas
RangeFormula
A5:A41A5=SEQUENCE(EOMONTH(TODAY(),0)-A2+1,,A2)
B5:B41B5=IF(ISODD(DAY(A5#)),"odd","even")
C5:C41C5=LEFT(D5#,1)
D5:D41D5=TEXT(A5#,"ddd")
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A5:D5000Expression=$A5<>""textNO



.. and if I change A2

24 11 15.xlsm
ABCDE
1
215/11/2024
3
4
515/11/2024oddFFri
616/11/2024evenSSat
717/11/2024oddSSun
818/11/2024evenMMon
919/11/2024oddTTue
1020/11/2024evenWWed
1121/11/2024oddTThu
1222/11/2024evenFFri
1323/11/2024oddSSat
1424/11/2024evenSSun
1525/11/2024oddMMon
1626/11/2024evenTTue
1727/11/2024oddWWed
1828/11/2024evenTThu
1929/11/2024oddFFri
2030/11/2024evenSSat
21
22
23
CF Spill
Cell Formulas
RangeFormula
A5:A20A5=SEQUENCE(EOMONTH(TODAY(),0)-A2+1,,A2)
B5:B20B5=IF(ISODD(DAY(A5#)),"odd","even")
C5:C20C5=LEFT(D5#,1)
D5:D20D5=TEXT(A5#,"ddd")
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A5:D5000Expression=$A5<>""textNO
 
Upvote 0
Solution
I'm sure it will. Coincidentally, your choice of EOMONTH & SEQUENCE to generate dates for your first column is very similar to how my first column generates an array of [eo-]months from a calculated start date.
 
Upvote 0

Forum statistics

Threads
1,224,739
Messages
6,180,676
Members
452,993
Latest member
FDARYABEE

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