+ Reply to Thread
Results 1 to 9 of 9

Need to call up info from cells based on values from another

  1. #1
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Question Need to call up info from cells based on values from another

    So, here's a sample of a spreadsheet to give you an idea for what I'm dealing with.

    NeedHelp.PNG

    \1

    What I want to do is create a formula that will show how many people left a dept during a certain period of time. Maybe I want to see how many workers left the "Home" department during January 2016. Is there a way that I can make a formula that says to check if a range has any cells that say "Home" and then if so, it could check another range to see if the date is between 1/1/16 and 1/31/16 (but only for the cells whose row had the "Home" value), and then return a count of that number. What about if I wanted to see how many had left in the last 30 days? I know there's a TODAY() thing you can use for formulas like that, right?

    Like, I can get it to count how many cells say "Home". And I can get it count how many cells have a value between 1/1/16 and 1/31/16. But I can't figure out how to get a formula that returns a count only when both criteria are met.

    Any help would be appreciated, thanks!!
    Last edited by TnD_Guy; 04-05-2016 at 05:55 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Need to call up info from cells based on values from another

    Try this:

    =COUNTIFS(F:F,"Home",C:C,">="&DATE(2016,1,1),C:C,"< "&DATE(2016,2,1))

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Re: Need to call up info from cells based on values from another

    Thank you, that seems to be working!

    How would I set it up so that it returns values from the last 30 days only? Like, I only want to see how many people from "Home" have left in the last 30 days? I know it will probably involve that TODAY() thing.
    Last edited by TnD_Guy; 04-06-2016 at 01:56 PM.

  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: Need to call up info from cells based on values from another

    Maybe this...

    =COUNTIFS(F:F,"Home",C:C,">="&TODAY()-30)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Re: Need to call up info from cells based on values from another

    BOOM! That's it!! Thank you so much!!

  6. #6
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Re: Need to call up info from cells based on values from another

    Quote Originally Posted by Tony Valko View Post
    Maybe this...

    =COUNTIFS(F:F,"Home",C:C,">="&TODAY()-30)
    Just curious, what does the >= do in the formula? I get the rest of it.

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

    Re: Need to call up info from cells based on values from another

    It means greater than or equal to.

    In most other functions we can just do this:

    =IF(A1>=TODAY()-30...

    However, in the COUNTIF(S) function we have to use quotes and concatenate when used with cell addresses or other functions:

    =COUNTIFS(...,">="&TODAY()-30)

    =COUNTIF(A:A,">="&B1)

  8. #8
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Re: Need to call up info from cells based on values from another

    Quote Originally Posted by Tony Valko View Post
    It means greater than or equal to.

    In most other functions we can just do this:

    =IF(A1>=TODAY()-30...

    However, in the COUNTIF(S) function we have to use quotes and concatenate when used with cell addresses or other functions:

    =COUNTIFS(...,">="&TODAY()-30)

    =COUNTIF(A:A,">="&B1)
    So let me get this straight:

    =COUNTIFS(F:F,"Home",C:C,">="&TODAY()-30)

    means:

    Count if the following criteria are met: the F column says "Home" and the C column has a value that is greater than or equal to today's date minus 30 days.

    Normally when you use the quotes, you're looking for a direct value. That is, the formula would only return a count if the value of the cell was =<. You're saying that with COUNTIFS, you use the quotes to denote that we are looking for a value that meets that operation in the quotes (in this case, greater than or equal today minus 30 days). Do I have this right?

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

    Re: Need to call up info from cells based on values from another

    Yep, that's right.

    One of Excel's many quirks!

+ 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] Formula to work out values based on info fro other columns
    By CherryM2015 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-24-2015, 10:07 AM
  2. Replies: 1
    Last Post: 12-13-2013, 05:19 PM
  3. Count Unique Values based on Specfic info
    By WNErika in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2012, 03:39 PM
  4. Call Top3 based on duplicate data and ranking info
    By Sophyex in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-19-2011, 01:24 PM
  5. Referencing Cell Info to call a File
    By stuckupnorth in forum Excel General
    Replies: 2
    Last Post: 07-07-2006, 10:48 AM
  6. Checking info against cells containing multiple values
    By systematic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2005, 03:02 AM
  7. [SOLVED] Run a command based on info in other cells
    By Chris Williams in forum Excel General
    Replies: 0
    Last Post: 07-27-2005, 03:05 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