+ Reply to Thread
Results 1 to 2 of 2

Cell returns value if another cell fits within a date range

  1. #1
    Registered User
    Join Date
    02-04-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Cell returns value if another cell fits within a date range

    Here's a quick summary of the purpose of this formula... My company hires out equipment and we need to keep track of where a piece of equipment was at a given time and who to charge the equipment to for a particular week or month.

    Each piece of equipment will have a separate sheet, which will list all of the hire contracts which have been placed on that machine:
    Column B: Hirer name
    Column C: Contract start date
    Column D: Contract expiry date

    Then there will be a main sheet (Summary) which will have all equipment listed, and all of the chargeable dates listed (see example below)

    Week 1 ||
    Week Commencing (B6) | Week Ending (C6) ||
    25/11/2013 (B7) | 1/12/2013 (C7) ||

    I want to add a Box underneath each piece of equipment on the main sheet that will show who to charge to. For example, underneath Week 1, I want it to show who the hirer is based on whether the Week Commencing to Week Ending dates fit within the contract start and expiry dates.

    I have come up with a formula that almost works, but I can only get it to refer to a single cell in the equipment sheet. As soon as I try to get it to refer to all columns, it just automatically comes up with 'not on hire'.

    This is my formula: =IF(AND(('Equipment1'!C14<='Summary'!C7),('Equipment1'!D14>='Summary'!B7)),('Equipment'!B14),"Not on hire")

    I hope that all makes sense. Any help would be greatly appreciated (my head is spinning!)

  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,678

    Re: Cell returns value if another cell fits within a date range

    Hi,
    Probably there is no answer, because without test date it is not that easy to suggest you a proper formula.

    Let me try:

    Please Login or Register  to view this content.
    This is not a standard formula committed with Enter key. It is array formula. Once you write it in your cell or in a formula stripe, commit it with keys: Ctrl+Shift+Enter (Ctrl+Shift hold, press Enter, release Enter, release other two).

    Try it - it shall work. Of course you probably shall go down further than row 20. But not go too far (like row 10000 etc) - it will noticeably slow down Excel.
    Best Regards,

    Kaper

+ 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: 7
    Last Post: 07-14-2017, 12:04 PM
  2. Replies: 2
    Last Post: 07-30-2013, 01:52 PM
  3. [SOLVED] Only displaying the text that fits in cell?
    By vmhatup in forum Excel General
    Replies: 4
    Last Post: 06-10-2012, 11:14 AM
  4. Replies: 4
    Last Post: 09-16-2011, 01:53 PM
  5. Date Value Returns a Number in Cell
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2009, 01:42 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