Formula to determine if a specific day of the week between two dates?

I am creating a spreadsheet to track my time PD & holiday. I usually work weekends, and my vacation allowance includes a specific maximum number of Sundays a year. Is there a way to calculate how much Sunday fall between a date range (or any day of the week, by the way)?

(i.e. If my vacation starts February 1, 2016 and ends March 2, 2016, Sunday how are included?)

I know that I can calculate how many weeks have passed, using = Quotient (DateDiff (Start_Date, End_Date), 7), but it is possible to include two Sundays in a period of 7 days.

Hi Eric,.

Here is one approach.

C2 = A2 + (7−WEEKDAY(A2,2))

This concludes the first Sunday following the start date.

D2 = STRIPDURATION ((B2−C2) ÷7)

I formatted this column without decimal places to see full weeks of the first numbers Sunday.

Quinn

Tags: iWork

Similar Questions

  • by selecting specific days of the week for the date range?

    I have a table with a number of clients for about a year, but I want to only select Wednesday and Thursday of
    every week, since the beginning of the dates. Table is simple and has two columns. Each line is separate from a Date
    There is no duplicate of Date, it is counted for every day of the year.

    column 1: number of clients, count (customer_id)
    column 2: Date

    Need help with the best way to achieve this.

    Not sure if it is even possible to select a date in the name of the day?

    Basically, I want to select every Wednesday and Thursday of each week and compare the counts during the week, the week during
    week for the whole week see if charges go upwards or downwards, to get trends, thank you!

    Hello

    Kodiak_Seattle wrote:
    I have a table with a number of clients for about a year, but I want to only select Wednesday and Thursday of
    every week, since the beginning of the dates. Table is simple and has two columns. Each line is separate from a Date
    There is no duplicate of Date, it is counted for every day of the year.

    column 1: number of clients, count (customer_id)
    column 2: Date

    Need help with the best way to achieve this.

    Not sure if it is even possible to select a date in the name of the day?

    Sorry, we don't know what you want.

    To see if a date given (dt) is a Wednesday or Thursday, you can use:

    WHERE   TO_CHAR ( dt
              , 'DY'
              , 'NLS_DATE_LANGUAGE=ENGLISH'     -- If necessary
              )  IN ('WED', 'THU')
    

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • Days of the week in a month

    I want to get every day of the week in a month.
    I mean I have beteen date setting
    from 12/01/07 to 31/07/12
    and I need every day of the week between these dates.

    Please tell me how?

    Hey Ghulam,

    I want to get every day of the week in a month.

    Query:

    SELECT     TRUNC (SYSDATE, 'MONTH') + LEVEL - 1 the_date,
               TO_CHAR (TRUNC (SYSDATE, 'MONTH') + LEVEL - 1, 'Dy') dt
          FROM DUAL
         WHERE TO_CHAR (TRUNC (SYSDATE, 'MONTH') + LEVEL - 1, 'Dy') NOT IN
                                                                   ('Sat', 'Sun')
    CONNECT BY LEVEL <= LAST_DAY (SYSDATE) - TRUNC (SYSDATE, 'MONTH') + 1;
    

    Thank you
    Shankar

  • Citing the calendar in day of the week (Mon, Mar, sea etc)...

    Hello

    How to invoke the native calendar to a specific day of the week, as Monday.

    If today is Monday call for Monday, if today of call Tuesday to next Monday, etc.

    You're right, official docs seems to be inaccurate, it must be:
    Action: "bb.calendar.OPEN."
    MIME: "text/calendar".
    Data : '? "view annex = & date = MON Jul 20% 2027% 202015.

    'view' application works and will actually view day but date of query does not work, although I respected the date format required in this doc:
    https://developer.BlackBerry.com/native/documentation/device_platform/invocation/calendar.html

    I tried with a few different date format but cannot make it work.

  • JavaScript anomaly on the number of days between two dates

    Use ApEx 4.0, I found an anomaly in a javascript code that calculates the number of days between two dates, the current_date and the past_date. If the past and present is the or before March 10, 2013, and the current_date lies between 10 March 2013 and November 3, 2013, the number of days will be from 1 day to less than the actual number. Between November 3, 2013 and on 4 November 2013, the increments of number by 2, then the count will be accurate from this date forward.

    Here are some examples:

    March 10, 2013 = 69 days of December 31, 2012
    March 11, 2013 = 69 days of December 31, 2012
    March 12, 2013 = 70 days of December 31, 2012

    November 3, 2013 = 306 days in December 31, 2012
    November 4, 2013 = 308 days in December 31, 2012

    11 March should be 70 and 12 March should be 71. November 3 is 307 and 4 November corrects the number of fake, which began March 11.

    Change the past_date to March 10, 2013 produces the following:

    March 10, 2013 = 0 days of March 10, 2013
    March 11, 2013 = 0 days of March 10, 2013
    March 12, 2013 = 1 days of March 10, 2013

    But change the past_date to 11 March 2013, product of the correct numbers:

    March 11, 2013 = 0 days of March 11, 2013
    March 12, 2013 = 1 days of March 11, 2013
    March 13, 2013 = 2 days of March 11, 2013

    I would certainly all help to determine the cause of this anomaly. Here's the javascript code:

    var w1 = ($v ("P48_PAST_DATE"));
    W1 = (w1.toString ());
    vmon var = (w1.substr (3.3));
    vyr var = (w1.substr (7));
    var r = (vyr.length);
    If (r == 2)
    vyr. = (parseFloat (vyr) + 2000);
    vday var = (w1.substr (0.2));
    var y = (vmon.concat ("", vday, ",", vyr));
    y = Date.parse (y);

    var w2 = ($v ("P48_CURRENT_DATE"));
    var vmon2 = (w2.substr (3.3));
    var vyr2 = (w2.substr (7));
    var vday2 = (w2.substr (0.2));
    var x = (vmon2.concat ("", vday2, ",", vyr2));
    x = Date.parse (x);

    var numdays = (x - y);
    numdays = (Math.floor(numdays / 86400000));
    $s ("P48_NUMBEROFDAYS", numdays);

    Did you google for something like "javascript number of days between two dates. I think you will find the explanation to this observation:

    This method does not work correctly if there is an advanced economies jump between the two dates.

    There are examples available to calculate the difference between two dates.

  • difference between two dates in the year/month/day in Obiee

    Hi gurus,

    I know this question have been asked and answered several times but I have a requirement that is a little different, then the previous ones.

    I want to calculate the difference between two dates in OBIEE10g in year/month/day format similar to the below SQL output

    SQL > select end_date, start_date,

    trunc (months_between (end_date, start_date) / 12) years.

    months of mod (trunc (months_between (end_date, start_date)), 12).

    End_date - add_months (start_date, trunc (months_between (end_date, start_date))) days

    t

    Thanks in advance

    SK

    Search for this

    "TIMESTAMPDIFF IN THE FORM OF MTHS # YEARS."

    or else

    To get the current mandate of employees since the date of hiring in the form of # years # mths or # year (s) # month (s)

    Concat (concat (cast (TIMESTAMPDIFF (SQL_TSI_Month, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) / 12 as char),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Month (s)'))

    Concat (concat (CAST (TIMESTAMPDIFF (SQL_TSI_YEAR, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) as CHAR),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Mth (s)'))

  • average amount of an article during the days of the week to a month

    Dear members,

    I want an application that compiles the data as below.

    Point 1 first day of the week saying Monday by 10 in a specific month

    Article 1 Monday next 20th of the same month qty

    Article 1 Monday 25th of the same month next qty

    Article 1 Monday next 22nd of the same month qty

    If there are 4 four Mondays of the month

    the avg of 1 article is (10 + 20 + 25 + 22) / 4 = 19.25

    Similarly, avg of article 2, point 3, point 4. .on every Monday, Tuesday, Wednesday... for a month.

    kindly show me the way...

    Thank you.

    teefu

    Lahore.

    Hi teefu,

    Try this

    create table ts1

    (sale_date date, item_code number, number of qty_sold);

    Insert the ts1

    values (to_date('02-Jun-2014','DD-mon-YYYY'), 1, 10);

    Insert the ts1
    values (to_date('16-Jun-2014','DD-mon-YYYY'), 1, 20);

    Insert the ts1
    values (to_date('23-Jun-2014','DD-mon-YYYY'), 1, 30);

    Insert the ts1
    values (to_date('23-Jun-2014','DD-mon-YYYY'), 1, 25);

    Insert the ts1
    values (to_date('30-Jun-2014','DD-mon-YYYY'), 1, 30);

    Insert the ts1
    values (to_date('02-Jun-2014','DD-mon-YYYY'), 1, 10);

    Insert the ts1
    values (to_date('05-Jun-2014','DD-mon-YYYY'), 1, 70);

    Insert the ts1
    values (to_date('12-Jun-2014','DD-mon-YYYY'), 1, 150);

    Insert the ts1
    values (to_date('26-Jun-2014','DD-mon-YYYY'), 1, 40);

    Select item_code, to_char(sale_date,'Day') day, avg (qty_sold) avg_sold

    ts1 by item_code group, to_char (sale_date, 'Day')

    output

    ITEM_CODE DAY AVG_SOLD

    --------- --------- ---------

    1 Monday 19,25

    1 Thursday 86.666667

    Select the day of item_code, to_char (sale_date, 'Day'),

    Sum (qty_sold) wheel (TO_NUMBER (to_char (sale_date, 'w'))) avg_sold

    of ts1

    Item_code group, to_char(sale_date,'Day');

    ITEM_CODE DAY AVG_SOLD

    --------- --------- ---------

    1 Monday 15.4

    1 Thursday 65

  • Display a date only when it is a certain day of the week in BI answers

    Hello

    I'm trying to display a date, but only if it's a Friday in BI answers.

    So far, I have in the formula in the column:

    ' BUSINESS day of the WEEK ("calendar of MQ - delivered". "Delivered the calendar Date") WHEN "Fri", THEN "calendar MQ - delivered". ' "Delivered to the calendar Date" END of OTHER NULL '


    It does not display anything, but I know that there is Friday in date data.

    Any ideas anyone?

    Thank you very much


    Graham

    Because the condition is not good ;-)

    Try this:

    CASE WHEN DAYOFWEEK("MQ Calendar - Delivered"."Delivered Calendar Date") = 5 then "MQ Calendar - Delivered"."Delivered Calendar Date" else null end
    

    See you soon
    Nico

  • Calendar of the days of the week

    I did a VI gives the date and time as a string of characters.

    I would like to have the n ° of the day of the week (value between 0 and 7) rather than son abbreviation.

    How should you configure the service pour have a number?

    Thank you pour your answers.

    Here's how you can get the number of the day of the week; Sunday as the first day. I leave it to you to concatenate the information into a string of characters to the desired format.

    The attention without delay loops which will load the CPU at 100%! I allowed myself to make some changes to your example.

  • Remove the DAY of the week from the taskbar!

    I can barely see at present; the day of the week came when I allowed updates.

    Above screenshots were taken with my Win 7 computer.

    Here are the screenshots taken in my Vista computer

  • Selection field of the day of the week as the appointment screen

    Hello

    I am developing a screen exactly similar to the ' screen new appointment "in the calendar application. But I can't find any appropriate UI component to expand the field of selection of the day of the week.

    In the 'new appointment screen of origin', this field of choice in week appears when you select "weekly" in the choicefield "recidivism". There are 7 characters, one for each day of week & you can select / deselect a day of week by pressing the space bar.

    Now, can someone please give me an idea on how to develop this field?

    Thank you.

    Hello

    Add HorizontalFieldManager and add ButtonFields on measurement (method overload f.e paint.).

    ButtonFieldListener is added to the custom field button.

    If selected the day of the week (given by the manufacturer) paint "BOLD", and another not.

    Kind regards

    Jochen

  • How to make it so that the DAY OF THE WEEK looks with the date and time?

    I had the day of the week, introduce yourself on XP, but it is a feature that they took off with Windows 7?  Does anyone know how to make it stay there permanently?

    Thank you

    Time, day and date will appear on the taskbar if you double its height. Unlock the taskbar and drag it up a notch with the mouse cursor...

  • Recurring appointment Set for certain days of the week each month in the calendar on Surface RT?

    It seems to me that this is not possible, but is there a way I can put a recurring appointment for a certain day of the week of each month in the calendar on the Surface RT? For example, a meeting Tuesday on two or one excursion each fourth Sunday?  I know that this is possible in Outlook on a PC and I would like to do it on the Surface RT as well.  Most of my recurring appointments are of this type.  When I recur every month on the Surface, it just sets it for the same date (for example the 12th of each month) instead of the second Tuesday.  Thank you!

    Hi Lisa,

    You were correct when you say that 'it seems to me that's not possible. ' The recurring appointment for some day of the week each month in the calendar on Surface RT cannot be done by date and not day.

    Good day!

  • Why Windows 8 'Calendar' app has no option to change the first day of the week?

    Why can't I change the first day of the week in 'Calendar' app?

    Hi Andriamparany,

    Windows calendar - like some other ' standard' Windows 8 applications - is pretty basic and was obviously designed to speed up tasks 'on the fly'. As soon as it comes to advanced settings for these applications, you will need to upgrade to the "long" version

    A good example is changing the 1st day of week / time of starting the day... To do this, you must go to http://Outlook.com (what I called the "expanded version" of Windows 8 Mail, calendar, people... APSS). So, from your browser preferred:

    • Open http://Outlook.com and enter your address email + password if necessary
      ==> By default, it displays your emails
    • Click the arrow to the bottom of the Panel that is located next to Outlook - upper left corner of the page
      ==> This shows 4 tiles: Mail, people, calendar and SkyDrive
    • Click on the calendar tile
      ==> That displays your calendar
    • Click the Options - just before a blue ? - link in the upper right of the screen

    Don't forget to save your changes when you have finished...

    Hope that answers & help

    See you soon

    LZ.

  • How to find the first day of the month following two years one year from now?

    Hello

    I need to find the first day of the month following two years ago, based on the current date.

    For example: If today is the 31/08/2015 so I need to find the date range between 31/08/2015 and on 09/01/2013. How can I write an SQL which allows to automate this calculation instead of hard-coding the values. Please do help me out with this so that I can build the SQL that can produce the desired result.

    Thank you

    Dhilip

    find the start of the month - 2 years in advance, early - 2 years + 1 months in advance and go back 1

    Select trunc (add_months(sysdate,24), 'MM'), trunc (add_months(sysdate,25), 'MM') - 1 double;

Maybe you are looking for

  • Problem with Firfox 6.02 and Google search

    I've recently updated to the latest version of FF to 6.02. Since then, the advanced search on the Google search engine link is inaccessible. Is that what someone else has this problem or is this a problem with the latest version of Firefox?

  • Problems with the keyboard on A60

    My keyboard/TouchPad has had something wrong with it majorly for the past month. He started with the TouchPad that is becoming more and more uncertain. Then one day I turned on my laptop and, after entering my password XP to go to my desktop, I was n

  • Cannot access BIOS laptop

    Hi I just got a new Lenovo G50, use F1 and F2 to start my computer does not. Could someone please help me off course I got a 10 to win.

  • under folders Security

    OS: Windows Server 2008R2 (64-bit) Hey guys,. I'm looking for some ideas. There is a server that I am the admin who has a folder with some protected data on it. The problem is that there are about 1 000 subfolders, each needs its own security setting

  • Zune on Windows XP Media Center Edition 2002 software

    Is there anyway to get the Zune software to work on Windows XP Media Center Edition 2002?