+ Reply to Thread
Results 1 to 3 of 3

Excel code to sum different prices depending on the range the price is located.

  1. #1
    Registered User
    Join Date
    06-03-2012
    Location
    Medellin, Colombia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Excel code to sum different prices depending on the range the price is located.

    I hope you can help me... Excuse my english
    I need to create a formula to calculate multiple ranges of prices.
    Let me give you and example... The answer must be shown in column B

    If the value is between 0 - 99999 i need it to sum 28000 to the column A and show it in column B
    If the value is between 100000 - 199999 i need it to sum 38000 to the column A
    If the value is between 200000 - 249999 i need it to sum 48000 to the column A
    If the value is between 250000 - 499999 i need it to sum 58000 to the column A
    If the value is between 500000 - 749999 i need it to sum 68000 to the column A
    If the value is between 750000 - 999999 i need it to sum 78000 to the column A
    and so on.


    A -------------------------- B
    96000
    36000
    128000
    356000
    458000

    Thank in advance.

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Excel code to sum different prices depending on the range the price is located.

    Hi

    The formula for this is:

    =IF(AND(A1>0,A1<=99999),SUM(A1,28000),IF(AND(A1>=100000,A1<=199999),SUM(A1,38000),IF(AND(A1>=200000,A1<=249999),SUM(A1,48000),IF(AND(A1>=250000,A1<=499999),SUM(A1,58000),IF(AND(A1>=500000,A1<=749999),SUM(A1,68000),SUM(A1,78000))))))
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Excel code to sum different prices depending on the range the price is located.

    It looks like you can use something like:
    =18000+10000*LOOKUP(A2,{0,10000,20000,25000,50000,75000},{1,2,3,4,5,6})

    or even

    =18000+10000*LOOKUP(A2,{0,1,2,2.5,5,7.5}*10000,{1,2,3,4,5,6}) where A2 holds the raw value
    Last edited by Cutter; 06-04-2012 at 06:58 AM.

+ 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