+ Reply to Thread
Results 1 to 7 of 7

Compounding returns with a lookup

  1. #1
    Registered User
    Join Date
    08-15-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Compounding returns with a lookup

    Hi All

    I am struggling coming up with a easy way to compound returns from a large list.

    Say i have a spreadsheet with
    Column A (animals) Column B (return)
    Dog 5
    Dog 7
    Cat 3
    Cat 2
    Mouse 9

    I want to run the formula {=(product(1+B1:B4/100)-1)} which compounds the returns. But i only want to compound like animals.

    So I would have a List sheet that contains the set of Animals so i could use a lookup function.

    Column A (List)
    Cat
    Dog
    Mouse

    I thought something like =vlookup(A1, Animals(product(1+B1:B4/100)-1),2, false) but i need to get all the Cats and Dogs not just one!
    Any help would be muchly appreciated.

    Cheers

  2. #2
    Registered User
    Join Date
    08-15-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compounding returns with a lookup

    PS writing out the product function =((1+A1)*(1+A2)*(1+A3))-1) but the number of variables is well variable so I think Product is the way to go here. Or maybe some sort of code?

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Compounding returns with a lookup

    So the expected result is CAT=5 DOG=12 MOUSE=9 ??

    If YES, then sumif does the job.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    08-15-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compounding returns with a lookup

    Nope,

    Dog 12.35%
    Cat 5.06%
    Mouse 9%

    For Dog as a formula {=(product(1+ A2:A3/100)-1)} or =((1+5/100)*(1+7/100))-1)

    So basically i want a 'productif' statement, its just that none seems to exist so you have to get creative.

    PS you from Kythera? My Mum is from Karava and Dad Viaradika!
    Last edited by funkydim; 12-03-2012 at 07:15 AM.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Compounding returns with a lookup

    ...PS you from Kythera? My Mum is from Karava and Dad Viaradika!
    No i am not from Kythera, but for my family and me, this island is our favourite place. We vist it since 1990, at least twice a year. Last time i was there in July! I will be there soon.

    Unfortunnately, i have no idea about your goal. As you said sumif gives a 12% for dogs that is not correct. Sorry.

  6. #6
    Registered User
    Join Date
    08-15-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compounding returns with a lookup

    Thanks for trying anyway.
    ANyone else have an idea?
    why doesn't excel have =PRODUCTIF?

  7. #7
    Registered User
    Join Date
    08-15-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Compounding returns with a lookup

    This should work in my opinion, but doesnt!
    =IF(--(A2=A2:A5),(PRODUCT(1+B2:B5/100)-1)*100)

    Using the unary -- to get 0/1 results so that it skips the invalid fields
    When I evaluate the formula I get this: =IF(--{TRUE;TRUE;FALSE;FALSE;FALSE},--PRODUCT(1+B2:B5/100)-1)

    So i would have hoped it would not calculate the FALSE ones, but still includes them therefore producting the entire field. Annoying!

+ 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