+ Reply to Thread
Results 1 to 6 of 6

Looking for a formula to reference a range of cells and return data if meets criteria

  1. #1
    Registered User
    Join Date
    01-24-2014
    Location
    Bentonville, Arkansas
    MS-Off Ver
    Excel 2007
    Posts
    6

    Looking for a formula to reference a range of cells and return data if meets criteria

    Howdy folks,

    New to the forum. I am dusting off my old Excel skills and have hit a wall.

    I am building a budget tracking document.

    Here is the real basic layout.

    On the first sheet, i have these basic columns.

    Column A--Users choose an expense category (i.e. "Training") from a drop-down list
    Column B--Enter expense amount
    Column C--Date of expense

    On another worksheet, I have built a summary for each expense category that will sum expense for that category per month. It adds expenses all together for each month, and also sums category by month to give an annual expense view.

    Ideally, I want Excel to be able to look at Column "A" in the first worksheet and look at the expense selected. If it finds the category in Column A, it will look in Column B for the amount. It will do this throughout Column A for that expense and then sum all of the expenses for that category into one cell on the second worksheet. This would be repeated for each category. So, basically when the user inputs data into worksheet one, everything will populate on the second worksheet by expense category, by month.

    Is this even possible in Excel? I know I have done versions of this in the past, but it was usually an If statement that looked something like this:
    =if(A1="Training Expense",B1,0)
    It would simply look at A1 and pull back B1 if it matched. But, I have never tried to do it by referencing a range of cells and then pulling the corresponding cell back as the data.

    Any help you can provide would be most appreciated.

    Thanks.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Looking for a formula to reference a range of cells and return data if meets criteria

    Will the dates all be within the same year?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-24-2014
    Location
    Bentonville, Arkansas
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Looking for a formula to reference a range of cells and return data if meets criteria

    They will be within the same fiscal year, but not the same calendar year. They will run from February 2014 to January 2015.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Looking for a formula to reference a range of cells and return data if meets criteria

    Try something like this...

    Data:

    Sheet1
    A
    B
    C
    1
    Category
    Amount
    Date
    2
    Category 1
    82
    2/28/2014
    3
    Category 4
    22
    4/2/2014
    4
    Category 2
    43
    2/9/2014
    5
    Category 5
    29
    5/7/2014
    6
    Category 2
    93
    3/20/2014
    7
    Category 1
    20
    3/30/2014
    8
    Category 3
    17
    4/10/2014
    9
    Category 3
    15
    5/1/2014
    10
    Category 1
    37
    4/26/2014
    11
    Category 1
    38
    1/9/2015
    12
    Category 5
    19
    5/9/2014
    13
    Category 4
    3
    1/5/2015
    14
    Category 4
    88
    12/5/2014
    15
    Category 4
    79
    5/7/2014


    Summary:

    Summary
    A
    B
    C
    D
    E
    1
    Feb 2014
    Mar 2014
    Apr 2014
    May 2014
    2
    Category 1
    82
    20
    37
    0
    3
    Category 2
    43
    93
    0
    0
    4
    Category 3
    0
    0
    17
    15
    5
    Category 4
    0
    0
    22
    79
    6
    Category 5
    0
    0
    0
    48


    B1:E1 are the 1st of the month dates formatted to display as mmm yyyy

    This formula entered in B2:

    =SUMIFS(Sheet1!$B$2:$B$15,Sheet1!$A$2:$A$15,$A2,Sheet1!$C$2:$C$15,">="&B$1,Sheet1!$C$2:$C$15,"<="&EOMONTH(B$1,0))

    Copy across as needed then down as needed.

  5. #5
    Registered User
    Join Date
    01-24-2014
    Location
    Bentonville, Arkansas
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Looking for a formula to reference a range of cells and return data if meets criteria

    This worked like a dream!! Thanks so much for the quick response and providing exactly what I needed. This forum rocks. This is going to save us so much time and add efficiency to our process.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Looking for a formula to reference a range of cells and return data if meets criteria

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Help! Reference a cell in same column if Range meets criteria
    By Trevorrow in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-12-2013, 03:31 PM
  2. Return Data from First Column That Meets Criteria
    By geschinger in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-18-2012, 09:30 AM
  3. Return a range of cells that meets a criteria
    By bgallagher1 in forum Excel General
    Replies: 3
    Last Post: 08-14-2010, 04:33 AM
  4. Return a range that meets a specific criteria
    By Brenda Blanchard in forum Excel General
    Replies: 5
    Last Post: 03-26-2009, 11:54 PM
  5. [SOLVED] Formula to return ADDRESS of cell in range that meets criteria
    By Christie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2005, 08: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