+ Reply to Thread
Results 1 to 5 of 5

Counting Nights Based on a Date Range

  1. #1
    Registered User
    Join Date
    03-13-2018
    Location
    US
    MS-Off Ver
    14.0
    Posts
    1

    Counting Nights Based on a Date Range

    Looking to create a formula that asks if the date range specified in equal to or greater than date above then "1" otherwise "0"

    I apologize if unclear. thanks!

    Capture.JPG

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,173

    Re: Counting Nights Based on a Date Range

    macros work...
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,802

    Re: Counting Nights Based on a Date Range

    A simple IF() function should handle this. Note that "between" is an AND() function. Perhaps the hardest part of the function is getting the relative and absolute references correct (here if you are unfamiliar with relative and absolute referencing in spreadsheets: https://support.office.com/en-ca/art...es_in_formulas ).Your picture cuts off the row and column labels, so I am assuming the upper left is A1.
    =IF(AND($A2<=C$1,C$1<=$B2),1,"") -- note how I mixed relative and absolute references to make this easy to copy.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,409

    Re: Counting Nights Based on a Date Range

    In C2:

    =AND(C1>=A2,C1<=B2)+0

    Drag accross
    Quang PT

  5. #5
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Counting Nights Based on a Date Range

    bump other replies are better

+ 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] Counting unique elements based on a date range
    By jumb0 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2012, 03:36 PM
  2. Replies: 2
    Last Post: 08-17-2012, 04:56 PM
  3. Calculating Weeks, Weekday nights and Weekend nights
    By bngguy in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-26-2010, 01:41 PM
  4. Replies: 4
    Last Post: 12-09-2009, 06:34 AM
  5. Counting date entries between a date range
    By Vetequk in forum Excel General
    Replies: 2
    Last Post: 05-12-2009, 12:32 AM
  6. Counting a date range
    By dwain in forum Excel General
    Replies: 4
    Last Post: 02-03-2009, 01:14 PM
  7. Counting unique records based on date range
    By aspAddict in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-26-2005, 04:05 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