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 a value 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 in a cell 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