Results 1 to 6 of 6

Thread: INDEX, MATCH, VLOOKUP to Exclude

  1. #1

    INDEX, MATCH, VLOOKUP to Exclude



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi
    I need to a formula to display any of the weeks total's that are greater than zero and excluding week 5. Is there a way to make a vlookup or an index/match to exclude criteria/data?
    PERSON WEEK TOTAL
    MRS.TWO
    5
    20
    MR.ONE
    5
    40
    MR.ONE
    26
    0
    MR.THR
    3
    5
    MR.THR
    5
    40
    MR.R
    5
    10
    MR.R
    1
    3
    MRS.FOU
    4
    30
    MRS.FOU
    5
    40
    MR.SEVE
    5
    40
    MRS.TEN
    5
    40
    MRS.TEN
    20
    2
    MR.ELEV
    3
    4
    MR.ELEV
    5
    25
    Thank You
    MZing81

  2. #2
    Quote Originally Posted by MZING81 View Post
    Hi
    I need to a formula to display any of the weeks total's that are greater than zero and excluding week 5. Is there a way to make a vlookup or an index/match to exclude criteria/data?
    PERSON WEEK TOTAL
    MRS.TWO
    5
    20
    MR.ONE
    5
    40
    MR.ONE
    26
    0
    MR.THR
    3
    5
    MR.THR
    5
    40
    MR.R
    5
    10
    MR.R
    1
    3
    MRS.FOU
    4
    30
    MRS.FOU
    5
    40
    MR.SEVE
    5
    40
    MRS.TEN
    5
    40
    MRS.TEN
    20
    2
    MR.ELEV
    3
    4
    MR.ELEV
    5
    25
    Thank You
    MZing81
    The idea is not to use a pivot table seeing that this already is one. I want a formula for it. It's going to be part of larger project with a generator. I have already put together an index and match formula with this table to pull data based on criteria from two columns. But the formula will me avoid using a autofilter in a macro which thru experience has been problematic for me.

  3. #3
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,294
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Assuming that your table starts in A1, and the name of your first subject is in G2:

    =SUMPRODUCT(--($A$2:$A$15=G2),--($B$2:$B$15<>5),$C$2:$C$15)
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  4. #4
    Quote Originally Posted by Ken Puls View Post
    Assuming that your table starts in A1, and the name of your first subject is in G2:

    =SUMPRODUCT(--($A$2:$A$15=G2),--($B$2:$B$15<>5),$C$2:$C$15)
    Gave it a try and don't think that it worked was intended only got "0". Maybe I'm missing something. By subject in g2 do you mean the the week number being 5 in column G or the actual employee name? Gave it a try with the employee list in column G but the totals arent accurate.


    Thanks for the help
    Last edited by MZING81; 2012-04-24 at 05:13 AM.

  5. #5
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,294
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Hi there,

    I've attached a sample workbook. Tell me if that's what you were after.
    Attached Files Attached Files
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  6. #6
    You could use these two array formulae

    =IF(ISERROR(SMALL(IF($B$2:$B$15<>5,ROW($A$2:$A$15)),ROW(A1))),"",
    INDEX($A$2:$A$15,SMALL(IF($B$2:$B$15<>5,ROW($A$2:$A$15)),ROW(A1))-1))

    and

    =IF(ISERROR(SMALL(IF($B$2:$B$15<>5,ROW($A$2:$A$15)),ROW(A1))),"",
    INDEX($C$2:$C$15,SMALL(IF($B$2:$B$15<>5,ROW($A$2:$A$15)),ROW(A1))-1))

    The first gets the name where week <> 5, and the second gets the total. Copy down as far as you think you might need.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •