+ Reply to Thread
Results 1 to 13 of 13

multiple lookup_value

  1. #1
    Inter
    Guest

    multiple lookup_value

    I have a spreadsheet with a list of source codes in column A and the number
    of downloads associated with each source code in column B.

    What i'd like to do is add the number of downloads from a range of source
    codes together. I've been using the VLOOKUP function but this is getting a
    little long.

    To put it another way, i want to find the number of downloads for each of 5
    different source codes and add them together.

    I've tried using SUMIF but can't seem to make it work correctly.

    Any assistance would be very gratefully received.
    Many thanks

  2. #2
    Bob Phillips
    Guest

    Re: multiple lookup_value

    =SUMPRODUCT(--(ISNUMBER(MATCH(A2:A20,{"Code1","Code2","Code3","Code4","Code5
    "},0))),B2:B20)

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Inter" <[email protected]> wrote in message
    news:[email protected]...
    > I have a spreadsheet with a list of source codes in column A and the

    number
    > of downloads associated with each source code in column B.
    >
    > What i'd like to do is add the number of downloads from a range of source
    > codes together. I've been using the VLOOKUP function but this is getting a
    > little long.
    >
    > To put it another way, i want to find the number of downloads for each of

    5
    > different source codes and add them together.
    >
    > I've tried using SUMIF but can't seem to make it work correctly.
    >
    > Any assistance would be very gratefully received.
    > Many thanks




  3. #3
    flow23
    Guest

    RE: multiple lookup_value

    try this SUMIF=(A:A,"=sourcecode",B:B) for each sourcecode



    "Inter" wrote:

    > I have a spreadsheet with a list of source codes in column A and the number
    > of downloads associated with each source code in column B.
    >
    > What i'd like to do is add the number of downloads from a range of source
    > codes together. I've been using the VLOOKUP function but this is getting a
    > little long.
    >
    > To put it another way, i want to find the number of downloads for each of 5
    > different source codes and add them together.
    >
    > I've tried using SUMIF but can't seem to make it work correctly.
    >
    > Any assistance would be very gratefully received.
    > Many thanks


  4. #4
    Forum Contributor
    Join Date
    03-21-2006
    Posts
    205
    Try Sumproduct.


    If you are having difficulties, post sufficient details and someone will help. It could be something like:
    =SUMPRODUCT(--($A$1:$A$100=C8)*($B$1:$B$100))

  5. #5
    Bob Phillips
    Guest

    Re: multiple lookup_value

    Or even

    =SUMPRODUCT(SUMIF(A2:A20,{"Code1","Code2","Code3","Code4","Code5"},B2:B20))

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    >

    =SUMPRODUCT(--(ISNUMBER(MATCH(A2:A20,{"Code1","Code2","Code3","Code4","Code5
    > "},0))),B2:B20)
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Inter" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have a spreadsheet with a list of source codes in column A and the

    > number
    > > of downloads associated with each source code in column B.
    > >
    > > What i'd like to do is add the number of downloads from a range of

    source
    > > codes together. I've been using the VLOOKUP function but this is getting

    a
    > > little long.
    > >
    > > To put it another way, i want to find the number of downloads for each

    of
    > 5
    > > different source codes and add them together.
    > >
    > > I've tried using SUMIF but can't seem to make it work correctly.
    > >
    > > Any assistance would be very gratefully received.
    > > Many thanks

    >
    >




  6. #6
    Inter
    Guest

    RE: multiple lookup_value

    I'm not sure SUMPRODUCT is the right formul as i'm not trying to multiply
    anything.

    The data looks like this;

    Source Downloads
    10155 200
    10156 300
    10157 400
    10158 500
    10159 600

    and i'm trying to write a formula that will give me the sum of the downloads
    for 10155, 10156 and 10158 (1000)

    I've tried both VLOOKUP and SUMIF with arrays
    (=VLOOKUP({10156,10155,10158},A1:A5,2,FALSE) and
    =SUMIF(A1:A5,{10156,10155,10158},B1:B5) respectively) but neither of these
    give me the answer i'm looking for.

    Cheers
    Stuart


  7. #7
    Inter
    Guest

    RE: multiple lookup_value

    I'm not sure SUMPRODUCT is the right formul as i'm not trying to multiply
    anything.

    The data looks like this;

    Source Downloads
    10155 200
    10156 300
    10157 400
    10158 500
    10159 600

    and i'm trying to write a formula that will give me the sum of the downloads
    for 10155, 10156 and 10158 (1000)

    I've tried both VLOOKUP and SUMIF with arrays
    (=VLOOKUP({10156,10155,10158},A1:A5,2,FALSE) and
    =SUMIF(A1:A5,{10156,10155,10158},B1:B5) respectively) but neither of these
    give me the answer i'm looking for.

    Cheers
    Stuart


  8. #8
    Inter
    Guest

    RE: multiple lookup_value

    I should say that i have got the right answer with multiple VLOOKUP formulas
    (i.e. vlookup(....)+vlookup(....) etc but i'm just trying to find out if
    there's a way to do the same thing with a slightly shorter formula

  9. #9
    Manoj
    Guest

    RE: multiple lookup_value

    Insert another field and with the required condition set values for a common
    set of values and then run a pivot table on this field. see if this works.

    "Inter" wrote:

    > I'm not sure SUMPRODUCT is the right formul as i'm not trying to multiply
    > anything.
    >
    > The data looks like this;
    >
    > Source Downloads
    > 10155 200
    > 10156 300
    > 10157 400
    > 10158 500
    > 10159 600
    >
    > and i'm trying to write a formula that will give me the sum of the downloads
    > for 10155, 10156 and 10158 (1000)
    >
    > I've tried both VLOOKUP and SUMIF with arrays
    > (=VLOOKUP({10156,10155,10158},A1:A5,2,FALSE) and
    > =SUMIF(A1:A5,{10156,10155,10158},B1:B5) respectively) but neither of these
    > give me the answer i'm looking for.
    >
    > Cheers
    > Stuart
    >


  10. #10
    Bob Phillips
    Guest

    Re: multiple lookup_value

    Well you may think that, but you are wrong

    =SUMPRODUCT(SUMIF(A2:A20,{"10155",10156,10158},B2:B20))


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Inter" <[email protected]> wrote in message
    news:[email protected]...
    > I'm not sure SUMPRODUCT is the right formul as i'm not trying to multiply
    > anything.
    >
    > The data looks like this;
    >
    > Source Downloads
    > 10155 200
    > 10156 300
    > 10157 400
    > 10158 500
    > 10159 600
    >
    > and i'm trying to write a formula that will give me the sum of the

    downloads
    > for 10155, 10156 and 10158 (1000)
    >
    > I've tried both VLOOKUP and SUMIF with arrays
    > (=VLOOKUP({10156,10155,10158},A1:A5,2,FALSE) and
    > =SUMIF(A1:A5,{10156,10155,10158},B1:B5) respectively) but neither of these
    > give me the answer i'm looking for.
    >
    > Cheers
    > Stuart
    >




  11. #11
    Bob Phillips
    Guest

    Re: multiple lookup_value

    It works, but I meant

    =SUMPRODUCT(SUMIF(A2:A20,{10155,10156,10158},B2:B20))

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Well you may think that, but you are wrong
    >
    > =SUMPRODUCT(SUMIF(A2:A20,{"10155",10156,10158},B2:B20))
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Inter" <[email protected]> wrote in message
    > news:[email protected]...
    > > I'm not sure SUMPRODUCT is the right formul as i'm not trying to

    multiply
    > > anything.
    > >
    > > The data looks like this;
    > >
    > > Source Downloads
    > > 10155 200
    > > 10156 300
    > > 10157 400
    > > 10158 500
    > > 10159 600
    > >
    > > and i'm trying to write a formula that will give me the sum of the

    > downloads
    > > for 10155, 10156 and 10158 (1000)
    > >
    > > I've tried both VLOOKUP and SUMIF with arrays
    > > (=VLOOKUP({10156,10155,10158},A1:A5,2,FALSE) and
    > > =SUMIF(A1:A5,{10156,10155,10158},B1:B5) respectively) but neither of

    these
    > > give me the answer i'm looking for.
    > >
    > > Cheers
    > > Stuart
    > >

    >
    >




  12. #12
    Peter
    Guest

    Re: multiple lookup_value

    Maybe this is completely off target, but have you thought to use a pivot
    table? It is highly versatile, great at collating date, and reliable. I
    used it for a colleague (more intuition than ability on my part) and it saved
    him the better part of a day and half each month!

    You might have to fiddle with the settings (ie dont just accept the 'count
    off ???" option for the data).

    regards,

    --
    Peter


    "Bob Phillips" wrote:

    > It works, but I meant
    >
    > =SUMPRODUCT(SUMIF(A2:A20,{10155,10156,10158},B2:B20))
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:%[email protected]...
    > > Well you may think that, but you are wrong
    > >
    > > =SUMPRODUCT(SUMIF(A2:A20,{"10155",10156,10158},B2:B20))
    > >
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from email address if mailing direct)
    > >
    > > "Inter" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I'm not sure SUMPRODUCT is the right formul as i'm not trying to

    > multiply
    > > > anything.
    > > >
    > > > The data looks like this;
    > > >
    > > > Source Downloads
    > > > 10155 200
    > > > 10156 300
    > > > 10157 400
    > > > 10158 500
    > > > 10159 600
    > > >
    > > > and i'm trying to write a formula that will give me the sum of the

    > > downloads
    > > > for 10155, 10156 and 10158 (1000)
    > > >
    > > > I've tried both VLOOKUP and SUMIF with arrays
    > > > (=VLOOKUP({10156,10155,10158},A1:A5,2,FALSE) and
    > > > =SUMIF(A1:A5,{10156,10155,10158},B1:B5) respectively) but neither of

    > these
    > > > give me the answer i'm looking for.
    > > >
    > > > Cheers
    > > > Stuart
    > > >

    > >
    > >

    >
    >
    >


  13. #13
    Inter
    Guest

    Re: multiple lookup_value

    I was wrong. Mr Bob Phillips, you were right.

    Thank you so much.

    Stuart


    "Bob Phillips" wrote:

    > It works, but I meant
    >
    > =SUMPRODUCT(SUMIF(A2:A20,{10155,10156,10158},B2:B20))
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:%[email protected]...
    > > Well you may think that, but you are wrong
    > >
    > > =SUMPRODUCT(SUMIF(A2:A20,{"10155",10156,10158},B2:B20))
    > >
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from email address if mailing direct)
    > >
    > > "Inter" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I'm not sure SUMPRODUCT is the right formul as i'm not trying to

    > multiply
    > > > anything.
    > > >
    > > > The data looks like this;
    > > >
    > > > Source Downloads
    > > > 10155 200
    > > > 10156 300
    > > > 10157 400
    > > > 10158 500
    > > > 10159 600
    > > >
    > > > and i'm trying to write a formula that will give me the sum of the

    > > downloads
    > > > for 10155, 10156 and 10158 (1000)
    > > >
    > > > I've tried both VLOOKUP and SUMIF with arrays
    > > > (=VLOOKUP({10156,10155,10158},A1:A5,2,FALSE) and
    > > > =SUMIF(A1:A5,{10156,10155,10158},B1:B5) respectively) but neither of

    > these
    > > > give me the answer i'm looking for.
    > > >
    > > > Cheers
    > > > Stuart
    > > >

    > >
    > >

    >
    >
    >


+ 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