+ Reply to Thread
Results 1 to 4 of 4

Array Formulas and Named Ranges

  1. #1
    Registered User
    Join Date
    10-27-2006
    Posts
    34

    Array Formulas and Named Ranges

    I have two named ranges, timeInA_D and timeOutA_D. Both ranges are the same size, 60,000 rows. I am trying to evaluate how many of the cells in timeInA_D are between 6:55 AM and 7:00 AM.

    I'm using the array formula

    {=COUNT(IF(AND(timeInA_D<A1,timeInA_D>A2),1,FALSE))}

    where A1 and A2 are 7:00 AM and 6:55 AM.

    The result of this count is "1". That is definitely not the right answer. Can anyone see what is wrong with my formula or another way of calculating this?

    Thanks

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    =sumproduct((timeInA_D<A1)*(timeInA_D>A2))

    Does that work? if not ate the times actually part of a date and so not in the range.

    Regards

    Dav

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    Easier to go with Dav's SUMPRODUCT suggestion, I think, but you could make your array formula work like this

    =COUNT(IF(timeInA<A1,IF(timeInA>A2,1)))

    You can't use AND with these type of fomulas because that will return a single result rather than an array....

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    I suspect you want <= and >= as comparison operators.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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