+ Reply to Thread
Results 1 to 5 of 5

Macro or a Formula that makes a calculation based on a MAX value between two fixed numbers

  1. #1
    Registered User
    Join Date
    04-05-2023
    Location
    France
    MS-Off Ver
    2010
    Posts
    4

    Question Macro or a Formula that makes a calculation based on a MAX value between two fixed numbers

    Hello,
    I need to create a macro or just a formula. I am not sure if a simple formula may be used instead of a macro. I don't have much experience with macros. If possible, please provide the whole code.

    In a cell A1, there is an amount of 30000.

    I need a formula or a macro that will allow to look up if the amount exceeds a predefined fixed amount of 10 000 and if so, takes a MAX value within a specific predefined range between two numbers 10 000 - 20 000. Then, deducts 10 000 (a fixed number) from a MAX value within that range. Then applies a fixed percentage of 11% on that amount and provides the result in the cell.

    Example 1. Cell A1 has the amount is 30000. Then the calculation should be : (20000 - 10000) x 0.11= 1100
    Example 2. Cell A2 contains the amount of 18000. Then the calculation should be : (20000-18000) x 0.11 = 220 In this case, 18000 is a Max value within a predefined specified range 10000 and 20000


    Thank you in advance for your help

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,208

    Re: Macro or a Formula that makes a calculation based on a MAX value between two fixed num

    Assuming a maximum number in D1 and a minimum number in D2.
    In B1:
    French version
    Please Login or Register  to view this content.
    English version
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    04-05-2023
    Location
    France
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro or a Formula that makes a calculation based on a MAX value between two fixed num

    Thank you a lot for your help

    There may also be that the value in A1 goes below that predefined range (because the values in the cell A1 may vary, as this is a total value of some other values).

    Could you let me know how to integrate another IF argument to say that if the value goes below some minimum value, the result should simply be 0 ?


    I tried to add one more IF condition inside the same formula -- IF(A1>20000,(20000-10000)*0.11,(A1-10000)*0.11,IF(A1<10000,0)), but strangely, it gives me an error message saying that there are too many arguments


    Quote Originally Posted by Artik View Post
    Assuming a maximum number in D1 and a minimum number in D2.
    In B1:
    French version
    Please Login or Register  to view this content.
    English version
    Please Login or Register  to view this content.
    Artik
    Last edited by Anne555; 04-08-2023 at 02:56 AM.

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,208

    Re: Macro or a Formula that makes a calculation based on a MAX value between two fixed num

    Please Login or Register  to view this content.
    Artik

  5. #5
    Registered User
    Join Date
    04-05-2023
    Location
    France
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro or a Formula that makes a calculation based on a MAX value between two fixed num

    Thank you a lot for your expert help.

+ 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. [SOLVED] Time calculation based on fixed rate
    By Khaldon in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-03-2021, 05:28 PM
  2. Replies: 4
    Last Post: 09-08-2016, 01:35 PM
  3. [SOLVED] A Macro Which Makes Negative Numbers In A Selected Range Red
    By zanshin777 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2016, 02:33 PM
  4. Replies: 9
    Last Post: 11-05-2014, 08:17 AM
  5. Replies: 2
    Last Post: 11-22-2011, 12:33 PM
  6. Get inputs to calculation based on column numbers if exist, if not use fixed value
    By amandaca in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2011, 11:30 AM
  7. Display fixed numbers based on another cell
    By 10jumps in forum Excel General
    Replies: 4
    Last Post: 03-25-2010, 08:17 AM

Tags for this Thread

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