+ Reply to Thread
Results 1 to 2 of 2

Creating automatic Data Set with Date values

  1. #1
    Registered User
    Join Date
    06-28-2020
    Location
    Istanbul
    MS-Off Ver
    O365
    Posts
    2

    Creating automatic Data Set with Date values

    Hi,

    I need to create some datasets in Excel. For that purpose, I need to be able to specify data ranges and their date formats accordingly.

    Sheet-1: Last 3 years

    It should include a single column with every day info on each line with the start of the first year. For example, we're in 2023. So, the first line after header should start with the year 2020 and each line's (day) date format should be like 17/04/2022.

    Sample:

    01.01.2020
    02.01.2020
    03.01.2020
    ..
    ..

    When I hit a formula or some other option, this lines should be arranged accordingly. If I select 1 year, then this should be listed for 1 year.

    Sheet-3: Last 7 days

    It should include a single column with every days and hours for the last 3 days on each line. For example, today is 5th, April. So, it should start with 29th, March the date format should be like 29/03/2023 01:00

    Sample:

    29/03/2023 00:00
    29/03/2023 01:00
    29/03/2023 02:00
    ..
    ..
    30/03/2023 00:00
    30.03/2023 01:00
    ..

    I need to create these two sheets according to these info automatically based on the current date. Is there any formula to make this happen?

    Thanks and Regards,

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,565

    Re: Creating automatic Data Set with Date values

    Here is a formula based proposal:
    1. For dates for the previous three years in Sheet1: =IF(ROW()=2,DATE(YEAR(E$1)-3,1,1),IF(A1<E$1,SUM(A1,1),""))
    2. For hourly output over the previous seven days in Sheet2: =IF(ROW()=2,DATE(YEAR(E$1),MONTH(E$1),DAY(E$1)-7),IF(SUM(MAX(A$1:A1),1/24)>=SUM(E$1,23/24),"",SUM(A1,1/24)))
    Note that on both sheets cell E1 is populated using: =TODAY()
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 08-16-2021, 11:33 AM
  2. Replies: 1
    Last Post: 08-15-2021, 06:14 PM
  3. Creating Automatic Summary Tables from a Master Data Table (Equation?)
    By tjb0012 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2017, 04:59 PM
  4. Replies: 3
    Last Post: 03-30-2016, 02:55 PM
  5. Automatic Capture of Data on a Certain date
    By kjmosp in forum Excel General
    Replies: 0
    Last Post: 07-08-2014, 03:23 PM
  6. Automatic date stamping for changes in column values
    By lforbes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2013, 07:12 AM
  7. Replies: 0
    Last Post: 04-27-2012, 07:32 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1