+ Reply to Thread
Results 1 to 8 of 8

How to change a value according to a rule - bigger than, smaller than

  1. #1
    Registered User
    Join Date
    02-26-2017
    Location
    UK
    MS-Off Ver
    MS2016
    Posts
    4

    How to change a value according to a rule - bigger than, smaller than

    Hello,

    My problem is very simple.

    I have a cell where there is a value which is a quantity.

    I need to create a formula to change the price according to the quantity.

    I already have the information of the different prices in the rows.

    From 0 to 10 units, price is 10 euros, from 11 to 20 units the price is 8 euros, more than 20 units the price is 5 euros.

    I tried to do that with the IF function by I guess you can't create multiple arguments such as bigger than x and smaller or equal than y.

    Thank you for your help.
    Last edited by olibeira; 02-26-2017 at 04:20 PM.

  2. #2
    Forum Contributor
    Join Date
    08-04-2004
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    186

    Re: IF fuction help

    =index($f$2:$g$4,match(a1,$f$2:$f$4,1),2)

    A1 is the quantity you enter and c1 is formula as above
    Attached Images Attached Images

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: How to change a value according to a rule - bigger than, smaller than

    You could create a lookup table as shown in post #2 and use...

    =LOOKUP(A1,F2:G4)

    or, if you did not want to create a lookup table you could use...

    =LOOKUP(A1,{0;11;21},{10;8;5})
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    02-26-2017
    Location
    UK
    MS-Off Ver
    MS2016
    Posts
    4

    Re: IF fuction help

    Quote Originally Posted by philaugust2004 View Post
    =index($f$2:$g$4,match(a1,$f$2:$f$4,1),2)

    A1 is the quantity you enter and c1 is formula as above
    Thank you, i tried putting that formula in excel but it doesnt work.

    Can you explain me the how the formula works so that I can try to replicate it.

    Update: I already understood. Thanks.
    Last edited by olibeira; 02-26-2017 at 04:31 PM.

  5. #5
    Registered User
    Join Date
    02-26-2017
    Location
    UK
    MS-Off Ver
    MS2016
    Posts
    4

    Re: How to change a value according to a rule - bigger than, smaller than

    Quote Originally Posted by jeffreybrown View Post
    You could create a lookup table as shown in post #2 and use...

    =LOOKUP(A1,F2:G4)

    or, if you did not want to create a lookup table you could use...

    =LOOKUP(A1,{0;11;21},{10;8;5})
    Thanks, I've tried the lookup table and it works.

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: How to change a value according to a rule - bigger than, smaller than

    Happy to hear you now have a working solution. You're very welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Registered User
    Join Date
    02-26-2017
    Location
    UK
    MS-Off Ver
    MS2016
    Posts
    4

    Re: How to change a value according to a rule - bigger than, smaller than

    Quote Originally Posted by jeffreybrown View Post
    Happy to hear you now have a working solution. You're very welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Yes, it solves.

    I never worked with that function before that's why I was having difficulties.

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: How to change a value according to a rule - bigger than, smaller than

    This might help you in your quest to learn about more formulas...

    https://support.office.com/en-us/art...90033e188#bm12

    or

    http://blog.contextures.com/archives...ays-16-lookup/

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2007 : Help using the IF fuction
    By tallonarcus in forum Excel General
    Replies: 4
    Last Post: 04-19-2010, 07:17 AM
  2. need a fuction that can do this (or can it be done)
    By Mrbanner in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  3. [SOLVED] need a fuction that can do this (or can it be done)
    By Mrbanner in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  4. need a fuction that can do this (or can it be done)
    By Mrbanner in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 02:05 PM
  5. need a fuction that can do this (or can it be done)
    By Max in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 11:05 AM
  6. need a fuction that can do this (or can it be done)
    By Max in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM
  7. need a fuction that can do this (or can it be done)
    By Mrbanner in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  8. need a fuction that can do this (or can it be done)
    By Mrbanner in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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