+ Reply to Thread
Results 1 to 2 of 2

Query Dataset and Return Value Based on Date Range

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Query Dataset and Return Value Based on Date Range

    Hi,

    I have a problem that I'd really like some help with if possible!

    I have a dataset that looks like the following:

    Start Date End Date Campaign Name Campaign Type
    1/9/17 1/10/17 Test Campaign Acq
    1/7/17 31/7/17 Affiliate Campaign Aff
    1/7/17 14/7/17 Other Campaign Oth

    I would like to write a formula/custom function that looks up the date range, then the campaign type and returns a unique list of campaign names. Obviously the dataset is much bigger than the one above, and this report needs to be done weekly so any help would be greatly appreciated.

    Also, if a custom function will do the trick, i am building this report in Google Sheets, so VBA won't be appropriate unfortunately.

    Thanks,

    Bigscreentv

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,424

    Re: Query Dataset and Return Value Based on Date Range

    Hi Bigscreentv. Welcome to the forum.

    This suggests a large data set. I would recommend using a helper column that indexes the row numbers of qualifying Campaign Names. This way you can reference the target date and target type such as in G1:H1 below.


    A
    B
    C
    D
    E
    F
    G
    H
    1
    Start
    End
    Name
    Type
    hlpr
    15/7/2017
    Aff
    2
    1/9/2017
    1/10/2017
    Test Campaign
    Acq
    Names
    3
    1/7/2017
    31/7/2017
    Affiliate Campaign
    Aff
    3
    Affiliate Campaign
    4
    1/7/2017
    14/7/2017
    Other Campaign
    Oth


    Then use this helper column formula in E2 filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    And this final output formula in G3 filled down until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

+ 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. Check a date range and return value based on the date range
    By KeithCar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-13-2015, 12:55 PM
  2. Return value based on date range
    By nehabhaumi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-26-2014, 02:37 PM
  3. [SOLVED] Return Value based upon date range
    By tsmor in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-06-2013, 11:05 PM
  4. [SOLVED] Return value based on ID and Date Range
    By just2cruz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-28-2012, 07:15 PM
  5. Return 1 or 0 based on Date Range
    By kwjoh in forum Excel General
    Replies: 8
    Last Post: 03-04-2011, 10:55 PM
  6. Excel 2007 : Want to return a value based on date range
    By mlittle74 in forum Excel General
    Replies: 2
    Last Post: 04-03-2010, 01:23 PM
  7. Compare Dates To Date Range & Return Date Based On Outcome
    By gusmontoya in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-03-2008, 09:06 PM

Tags for this Thread

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