Heading based on selection

Zubair

Active Member
Joined
Jul 4, 2009
Messages
314
Office Version
  1. 2016
Platform
  1. Windows
Dear Experts.

1st of all sorry I am unable to add XL2BB so putting below the view.

I need headings based on the selected range.

A1 = Data validation list Years, Regions
B1 = Data validation list to select as follows

Years
L1 M1 N1 O1 P1 Q1
Y1 Y2 Y3 Y4 Y5 Y6

Regions
L2 M2 N2 O2 P2 Q2
R1 R2 R3 R4 R5 R6

Based on the selection in Cell B1 I want headings in the range from D1

Condition 1
B2 = Y3

D1 E1 F1
Y1 Y2 Y3

G1:I1 should be blank


Condition 2
B2 = R6

D1 E1 F1 G1 H1 I1
R1 R2 R3 R4 R5 R6
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I have managed to get the following formula, no action required, thanks.

=IF($A$1="Regions",IFERROR(IF(COLUMNS($D1:D1)=MATCH($B$1,$L$1:$Q$1,0),INDEX($L$1:$Q$1,COLUMNS($D1:D1)),""),""),IFERROR(IF(COLUMNS($D1:D1)<=MATCH($B$1,$L$2:$Q$2,0),INDEX($L$2:$Q$2,COLUMNS($D1:D1)),""),""))
 
Upvote 0
Solution

Forum statistics

Threads
1,225,730
Messages
6,186,698
Members
453,369
Latest member
positivemind

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