+ Reply to Thread
Results 1 to 6 of 6

VBA - Finding a value, using specific criteria

  1. #1
    Registered User
    Join Date
    05-23-2013
    Location
    Iowa
    MS-Off Ver
    Excel 2007
    Posts
    84

    VBA - Finding a value, using specific criteria

    Hi all,

    I'm looking for some help with some code. What I'm trying to do is pretty easy to explain, I'm just not sure what's the most efficient way to do it.

    help.xls

    I attached an example of two of the worksheets that I would be using. One would have the census information (age, tenure, etc.) The other one is a volume analysis that counts how many people of a certain age there are. None of this I have a problem with, but what I need is an IF statement or something that will say: IF this person is 28, what is their salary? Then it would find their salary and add it to 'Total Salary' (C11 in the uploaded document).

    In simple terms: determine how much people at a certain age make in total.

    If I need to explain more, I'd love to.

    Thanks for any help.

  2. #2
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: VBA - Finding a value, using specific criteria

    A simple index and match formula on sheeet2
    Attached Files Attached Files

  3. #3
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: VBA - Finding a value, using specific criteria

    If you want the formula on sheet1 c11. drag it down

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-23-2013
    Location
    Iowa
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: VBA - Finding a value, using specific criteria

    Works if there is only one count, but for instance, if one of them have multiple counts (which usually happens) it didn't add them.

    Sorry, I should have specified a little more clearly - if there were two people at the age 40, who made $50k and $30k respectively, it would sum them.

    Thanks!

  5. #5
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: VBA - Finding a value, using specific criteria

    I was a formula person at some point in the past, now my mind is occupied with a code. I am pretty sure others(specially if you go in to the formula section of this site) who are savvy in a formula can easily crack it.

  6. #6
    Registered User
    Join Date
    05-23-2013
    Location
    Iowa
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: VBA - Finding a value, using specific criteria

    Quote Originally Posted by AB33 View Post
    I was a formula person at some point in the past, now my mind is occupied with a code. I am pretty sure others(specially if you go in to the formula section of this site) who are savvy in a formula can easily crack it.
    No problem Thanks for the direction AB33. Repped

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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