Formula to copy header after each empty row to next column

thedeadzeds

Active Member
Joined
Aug 16, 2011
Messages
451
Office Version
  1. 365
Platform
  1. Windows
Ia there a way to create a formula in column B so it copies the header from each section so it looks like the below. The next header starts after each empty row in column A. Thanks


Units/HoursUnit Hours
New Car Sales - RetailUnit Hours
New Car Sales - MotabilityUnit Hours
New Car Sales - FleetUnit Hours
New Car Sales - AgencyUnit Hours
Used Car SalesUnit Hours
ServiceUnit Hours
TurnoverTurnover
New Car Sales - RetailTurnover
New Car Sales - MotabilityTurnover
New Car Sales - FleetTurnover
New Car Sales - AgencyTurnover
Used Car SalesTurnover
ServiceTurnover
PartsTurnover
RentalTurnover
Total TurnoverTurnover
GP inc Other IncomeGP inc Other Income
New Car Sales - RetailGP inc Other Income
New Car Sales - MotabilityGP inc Other Income
New Car Sales - FleetGP inc Other Income
New Car Sales - AgencyGP inc Other Income
Used Car SalesGP inc Other Income
ServiceGP inc Other Income
PartsGP inc Other Income
RentalGP inc Other Income
Total GP inc Other IncomeGP inc Other Income
ExpensesExpenses
New Car Sales - RetailExpenses
New Car Sales - MotabilityExpenses
New Car Sales - FleetExpenses
New Car Sales - AgencyExpenses
Used Car SalesExpenses
ServiceExpenses
PartsExpenses
RentalExpenses
Total ExpensesExpenses
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hello, one option could be:

Excel Formula:
=LET(
a,A1:A40,
b,SCAN(0,a,LAMBDA(x,y,IF(y="",0,x+1))),
c,IF(b=1,a,IF(b=0,"",NA())),
SCAN("",c,LAMBDA(x,y,IF(ISNA(y),x,y))))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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