+ Reply to Thread
Results 1 to 5 of 5

How to separate my dataset in weekdays and week-ends?

  1. #1
    Registered User
    Join Date
    03-14-2016
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    21

    How to separate my dataset in weekdays and week-ends?

    Hey guys!

    I have in this file energy consumption for every 15min of every day of the year 2015. I want to get a few things out of this:

    1) I need to be able to separate to weekdays from the week-ends as consumption differs quite a lot
    --> Maybe there's also a way for me to add a list of national holidays and see those days go to the week-end category automatically?
    2) I want season average for these 2 categories (so I will have 8 series: 4 seasons divided in 2 set of days. For each series I will have data for the average day every 15 min)
    --> I can manage this part easily
    3) I want my 8 series to be divided in 3 categories: high, medium, low
    --> I want 3 equal categories. I should be able to do this with percentiles

    Thanks a lot people for you help people
    Attached Files Attached Files
    Last edited by VictorOnline; 03-17-2016 at 09:38 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: How to separate my dataset in weekdays and week-ends?

    In CZ2 I'd put:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    in DA1:DA13 a list of your national holidays

    I left only some first rows of data to keep file small
    note formulas in DA1:DA13 - may be you can use some of the dates there (like Christmas, Easter Monday, Ascension Day, etc.), while other dates, like Polish Constitution Day (May 3rd) etc. are probably useless for you
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: How to separate my dataset in weekdays and week-ends?

    Hi -

    Use the following formula to convert dates to days of the week:

    =CHOOSE(WEEKDAY(CONCATENATE(B2,"/",A2,"/",C2)),"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") Note, since I am not on European calendar, my date concatenation is reversed from yours (switch B2 and A2).

    I inserted a column and added the days in column D.

    Then use SUMPRODUCT to add up the days you want. I have written this formula for a small part of the data set so I could easily check the results.:

    =SUMPRODUCT((($E$2:$G$26)*($D$2:$D$26="Saturday"))+(($E$2:$G$26)*($D$2:$D$26="Sunday"))) This one sums up all the usage on Sat/Sun.
    =SUMPRODUCT((($E$2:$G$26)*($D$2:$D$26<>"Saturday"))*(($D$2:$D$26<>"Sunday"))) This one sums up all the weekday usage.

    It's simply a matter of addding more conditions to SUMPRODUCT to get the rest of your items (Seasonality, Holidays, etc.). Use + on your conditions to create an OR response (e.g., Saturday OR Sunday). Use multiplication (*) to create and AND conditions (e.g., Not equal to (<>) Saturday AND Sunday). You can add a list of Holiday dates, Season ranges, etc.

    The following link is an AWESOME explanation of SUMPRODUCT. You can do virtually anything with this function.

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

    Good luck.
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  4. #4
    Registered User
    Join Date
    03-14-2016
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    21

    Re: How to separate my dataset in weekdays and week-ends?

    Thanks people

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: How to separate my dataset in weekdays and week-ends?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Macro that displays all the weeks between Start Week and End Week (ends in next year)
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-31-2014, 05:38 AM
  2. Weekdays and week number starts from Thrusday and end with wednesday
    By farrukh in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-31-2014, 02:51 PM
  3. Create separate invoices from a dataset
    By jmmac in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-25-2014, 10:40 AM
  4. [SOLVED] IF statment to bring back RAG status on week end between multiple week-ends
    By jonathan.haynes in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-04-2013, 12:45 PM
  5. Replies: 0
    Last Post: 03-07-2013, 05:31 PM
  6. 5 days a week... but not weekdays
    By daisy3344 in forum Excel General
    Replies: 13
    Last Post: 02-07-2012, 10:31 AM
  7. Insert a new row when week ends / week starts?
    By dvent in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-09-2008, 01:13 PM

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