+ Reply to Thread
Results 1 to 3 of 3

Is there a quicker way to do this

  1. #1
    Forum Contributor
    Join Date
    11-17-2006
    Posts
    152

    Is there a quicker way to do this

    Hi,

    I think i am doing this the long way using VBA but there must be a quicker way using formulas???

    I have 3 columns of data

    A B C
    1 Alan 22
    1 Alan 10
    2 Carl 4
    1 Brian 67
    1 Alan 8
    3 Brian 2

    Can i do a formula that totals Column C if Column "A" = 1 and Column "B" = "Alan"

    So If i did this for Column A = 1 and Column B = Alan the sum total would be 40.

    There must be a formula/combination of formulas that can do this.

    Thanks

  2. #2
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387
    I'll assume that you want this count to change, so I'll assume that in Cells E1 and E2 you can select a number (corresponding to column A) and a name (corresponding to column B). So in this case, E1 would be "1" and E2 would be "Alan".

    Now in column D1, I would put this code and drag it down.

    Please Login or Register  to view this content.
    This code will create a column with the values from column C if they meet the criteria you specified in E1 and E2.

    Then just create a
    Please Login or Register  to view this content.
    formula whereever you want the total.

  3. #3
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi

    =SUMPRODUCT(--(A1:A6=1),--(B1:B6="Alan"),C1:C6)

    the critertia can be cell references holding the criteria values.

    Richard

+ 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. Quicker way?
    By Craiig in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-22-2008, 07:32 AM
  2. Quicker way to enter in multiple vba if statements
    By jubangy in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 05-20-2008, 03:15 AM
  3. Quicker VBA
    By sparx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2007, 06:47 AM
  4. Quicker way to enter formula
    By Dhruva101 in forum Excel General
    Replies: 8
    Last Post: 12-20-2006, 11:31 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