+ Reply to Thread
Results 1 to 3 of 3

Sum items in a lookup table.

  1. #1
    JICDB
    Guest

    Sum items in a lookup table.

    I work for a bus company that has 240 different routes. I also have a table
    in Excel that lists monthly ridership for each route. I use it as a lookup
    table to get data for another report. The problem? There are 6 of the 240
    routes that are served by more than one garage so they appear twice in the
    lookup table and I would like to get the sum of the ridership for that
    particular route from the table. Is this possible and if so how do I do it?

  2. #2
    bpeltzer
    Guest

    RE: Sum items in a lookup table.

    I gather you're using a lookup function now to find the ridership from a
    given route. VLOOKUP will return (0 or) 1 value. If you use SUMIF instead,
    you can get the sum from multiple matches. If, for instance, your route is
    in column A and ridership in column B, =vlookup(route,A1:A240,2,0) would give
    you ridership for the first match. =sumif(A1:A240,route,B1:B240) will give
    the total ridership for each match in the table.
    --Bruce

    "JICDB" wrote:

    > I work for a bus company that has 240 different routes. I also have a table
    > in Excel that lists monthly ridership for each route. I use it as a lookup
    > table to get data for another report. The problem? There are 6 of the 240
    > routes that are served by more than one garage so they appear twice in the
    > lookup table and I would like to get the sum of the ridership for that
    > particular route from the table. Is this possible and if so how do I do it?


  3. #3
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    Use SUMPRODUCT.

    =SUMPRODUCT(--(A1:A240=1),(B1:B240))

    A1:A240 are your routes, B1:B240 is your ridership. 1 represents the route. If your route is text, just be sure to enclose in quotes.

    Cheers,

    Steve

+ 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