+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Vlookup to count matches in two columns

  1. #1
    Registered User
    Join Date
    06-06-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Vlookup to count matches in two columns

    Hi,

    I have attached a simple spreadsheet all about the colour of toys. If someone could explain to me how to create the formula to summarise (on sheet 1) the number of times a certain toy is a certain colour (from sheet 2) using (I think) VLOOKUP, I will be able to solve my more complicated spreadsheet.

    It would make me very happy! I'm not having any luck on my own.

    Thank you,
    Notwen
    Attached Files Attached Files
    Last edited by NBVC; 06-10-2011 at 07:47 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Vlookup

    Try, in B3:

    =COUNTIFS('toy list'!$A$2:$A$13,$A3,'toy list'!$B$2:$B$13,B$2)

    copied down and across the columns
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-06-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Vlookup to count matches in two columns (COUNTIFS instead)

    Thank you, NBVC. That worked!

    Um, however, I realise that my 'more complicated' spreadsheet can't be solved with the COUNTIFS. I've attached a modified spreadsheet. I can't reorder a sheet so I don't think that VLOOKUP could be used. Can you help again, please?

    Thanks,
    Notwen
    Attached Files Attached Files

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Vlookup to count matches in two columns

    Does this work for you?

    =SUMIF(summary!$A$3:$A$5,$A2,INDEX(summary!$C$3:$E$5,0,MATCH(B$1,summary!$C$2:$E$2,0)))

    This assumes the red, yellow, blue table headers in both sheets may not be in the same order... otherwise you can just use:

    =SUMIF(summary!$A$3:$A$5,$A2,summary!$C$3:$C$5)

  5. #5
    Registered User
    Join Date
    06-06-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    [Solved] COUNTIFS() and SUMIF() example across sheets

    Thanks, NBVC!

    I used the simpler version of SUMIF() and it worked fine. I applied the idea to my more complicated spreadsheet and that, too, worked fine.

    Thank you so much!

    I've attached the finished spreadsheet in case someone wants to look at it.

    Cheers
    Attached Files Attached Files

+ 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