Plot a chart based on common date from multiple date rows using VBA.

Muhtar

New Member
Joined
Jul 3, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a data like this (with many dates and outputs, here is just a simplified example):
Capture.JPG


I want to plot a line chart showing all outputs with one single x-axis (CommonDate: 02/01/2024 - 02/21/2024). however, coming up with CommonDate row based on the date1/date2/date3/,,, etc is challenging. Can someone help? My goal is to create a CommonDate row and then plot all outputs in a single line chart.
 

Attachments

  • Capture.JPG
    Capture.JPG
    39.2 KB · Views: 1

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try this perhaps? This is a dynamic array formula so you only need to enter it in one cell and it will spill to the right assuming there is nothing in the way.

Book1
ABCDEFGHIJKLMNOPQRS
1Date 11/02/20242/02/20243/02/20244/02/20245/02/20246/02/20247/02/20248/02/20249/02/202410/02/202411/02/202412/02/202413/02/202414/02/2024
2Output 1898989898989898989898989
3Date 25/02/20246/02/20247/02/20248/02/20249/02/202410/02/202411/02/202412/02/2024
4Output 27895723
5Date 316/02/202417/02/202418/02/202419/02/202420/02/202421/02/2024
6Output 3826745454376
7
8
9Common Date1/02/20242/02/20243/02/20244/02/20245/02/20245/02/20246/02/20246/02/20247/02/20247/02/20248/02/20248/02/20249/02/20249/02/202410/02/202410/02/202411/02/202411/02/2024
1089898989897898899895897892893
11
Sheet1
Cell Formulas
RangeFormula
B9:Z10B9=SORT(HSTACK(FILTER(B1:R2,B2:R2<>""),FILTER(B3:R4,B4:R4<>""),FILTER(B5:R6,B6:R6<>"")),,,TRUE)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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