+ Reply to Thread
Results 1 to 10 of 10

Calculate output percentage based on input considering criteria

  1. #1
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Calculate output percentage based on input considering criteria

    Hello friends,

    I am unable to understand the mathematics behind a logic and that is why I cannot write a formula.
    I have two columns, Input and Output. Based on input, the output should be generated as per criteria below
    1. If the input is equal to or below 20% then output should remain same as input
    2. if the input is equal to or more than 100% then the output should be half of the input
    3. If the input ranges between 20% and 100% then it should calculate proper weightage and give the output.

    The cells marked in yellow are the desired output i am looking at. Please help me with a formula.

    Thank you

    inputoutput.png
    Last edited by sabha; 05-31-2021 at 05:22 AM. Reason: making solved

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: Calculate output percentage based on input considering criteria

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: Calculate output percentage based on input considering criteria

    And BTW

    Please don't quote entire posts unnecessarily. They clutter threads and make them hard to read.
    Use the "Quick reply" instead
    Thanks

  4. #4
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Re: Calculate output percentage based on input considering criteria

    Sorry about that
    I thought I attached the file. I am attaching it now
    Attached Files Attached Files

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate output percentage based on input considering criteria

    Please try at B2
    =SIGN(A2)*(MIN(ABS(A2),0.2)+MAX(0,ABS(A2)-0.2)/0.8*0.3)
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Re: Calculate output percentage based on input considering criteria

    Thanks @Bo_Ry
    I spent some time to understand the maths behind it. I understood the logic in formula where you have considered min and max values to look but could not figure out last part *0.3
    if possible can you please shed some light on it?
    Thank you

    EDIT : I tried with a new example from 10% 11% .... to 100%
    In this example, the first evaluated value should be 10% and last should be 50%
    Once I understand the reason behind the last part *0.3, I can work on other examples to clearly understand the solution.
    Please reply if you can. Thanks
    Last edited by sabha; 05-31-2021 at 04:40 AM.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate output percentage based on input considering criteria

    0.3 is from
    20% --> 20%
    100% -> 50%

    50%-20% = 30% = 0.3

  8. #8
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Re: Calculate output percentage based on input considering criteria

    Thank you for the explanation. I tried to incorporate that in another example but the last figure shows 46% instead of 50%. Could you please check the revised attachment? Thanks
    Attached Files Attached Files

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate output percentage based on input considering criteria

    =sign(a2)*(min(abs(a2),0.1)+max(0,abs(a2)-0.1)/0.9*0.4)

    20%- 100% --> /0.8

    10%-100% --> /0.9

  10. #10
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Re: Calculate output percentage based on input considering criteria

    Oh yes ! silly mistake from my side. I overlooked that 0.9 part in this bigger sample.
    Thank you so much for the explanation
    God bless !

+ 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] Input Postcode and Output Yes/No based on lookup
    By kersplash in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2018, 04:12 AM
  2. [SOLVED] When I enter values in INPUT Formulas calculate in OutPut
    By AaruJaan in forum Excel General
    Replies: 2
    Last Post: 02-01-2017, 12:54 PM
  3. [SOLVED] Calculate a percentage when row cell meets criteria..
    By DigitalWavez in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-31-2014, 08:24 AM
  4. Defined output based on Input given
    By dheeraj27 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-20-2013, 12:43 PM
  5. Defined output based on Input given
    By dheeraj27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2013, 12:33 PM
  6. Macros (fix) with criteria input from user then output with mail merge
    By Nicklebach in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2012, 10:16 AM
  7. Calculate output for the logic in the attached spreadhseet based on user input
    By tenn0228 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2009, 10:45 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