简体   繁体   中英

Excel formula to return value based on cell value within a range

数据截图

I need excel to sum user amount and price based on amount of users. However the pricing is staggered and the price per user is cheaper the more users you have

Users Price per user

1-10 600

11-20 500

21-30 400

31-40 300

41-50 200

50+ 100

Is it possible to have a formula which returns a value based on the number of users but uses the price depending on which pricing bracket the amount of users falls into

Is there a finite amount of users or could it be unlimited?

There are a couple of formula methods you could use but could become cumbersome if we are talking 20+ potential brackets.

  1. Compound IF statement:

Lets say A1 is where the number of users is entered Col B is where your lower brackets are held Col C is where your higher brackets are held Col D = price

=IF(AND($A$1>$B1,$A$1<=$C1),($A$1*$D1),IF(AND($A$1>$B2,$A$1<=$C2,($A$1*$D2).....,"") etc
  1. Create your brackets on a separate sheet and use a VLOOKUP to identify which bracket the user number lies within and multiple by the resulting bracket price.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM