+ Reply to Thread
Results 1 to 3 of 3

Multiple IFs + Date Range Then Return X

  1. #1
    Registered User
    Join Date
    05-19-2014
    Posts
    7

    Multiple IFs + Date Range Then Return X

    I have a table with the following information in it: Hospital Name, Type of Visit, Start Date, End Date, and Rate.

    There are 8 different Hospitals, 3 different Visit Types, varying Start/End dates for each Hospital/Visit Type, and then of course a specific rates corresponding to the previous criteria.

    So for example, let's say

    NYU Medical Center, ER Visit, 12/1/08 to 6/30/09 = $300

    The problem is the date ranges are different for each. So, in the example above, NYU Medical Center might have 11 different date ranges to pick from to get the correct rate for ER service. But they might only have 5 different date ranges to pick from to get the correct rate for Surgery Services.

    I'm trying to figure out if there is a way for me to just enter the Hospital Name, Type of Service, and a Date of Service, and basically go "If Hospital name = x, Type of service = y, and Date Rage is between 'a' and 'b' then rate = z." -- if they were all uniform date ranges, this would be much easier it seems. But because I'm not only dealing with different amounts of date ranges, but also different actual date ranges themselves, this seems much more tricky.

    Just to provide a further example, one set of date ranges for one hospital and visit type is:

    12/1/2008 6/30/2009
    7/1/2009 11/30/2009
    12/1/2009 12/31/2009
    1/1/2010 6/30/2010
    7/1/2010 12/31/9999 (present)

    And for the SAME hospital, but DIFFERENT Service Type, they are:

    12/1/2008 12/31/2008
    1/1/2009 6/30/2009
    7/1/2009 11/30/2009
    12/1/2009 12/31/2009
    1/1/2010 6/30/2010
    7/1/2010 3/31/2011
    4/1/2011 6/30/2011
    7/1/2011 12/31/9999 (present)

    Thanks in advance as always.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Multiple IFs + Date Range Then Return X

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-19-2014
    Posts
    7

    Re: Multiple IFs + Date Range Then Return X

    This is pretty close to what I'm working on. I have the hospital names and service types in dropdown boxes on another sheet. I just want to be able to pick Hospital A and Service Type B and enter in Date and if it falls between X & Y, then the rate = Z.

    Is this possible? Thank you.
    Attached Files Attached Files

+ 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] Return value if within range, return multiple values if ranges overlap
    By cde1983 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-17-2013, 06:16 AM
  2. Search date range +/- 7 days and return date that falls within range
    By tlafferty in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-13-2013, 03:26 PM
  3. Replies: 10
    Last Post: 02-19-2013, 12:05 PM
  4. Replies: 0
    Last Post: 08-14-2012, 01:18 PM
  5. Search named range for multiple matches to critera and return date & values
    By a.mack123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2011, 10:07 AM

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