Forum Discussion

DreCpt's avatar
DreCpt
Copper Contributor
Jan 09, 2023

Generate result based on selected text

Hello, everybody! I need your help! πŸ™‚

 

Please see the attached image. I have to calculate de Gross salary from Net and we have 2 situations:

  1. when the gross salary is calculated normally
  2. when the gross salary receives a 10% deduction from the government (special cases).

This means I am using 2 different formulas to generate the result based on this 10% deduction. One formula without the 10% deduction support from the government and another formula including the 10% deduction.

 

Is it possible that these 2 formulas change automatically depending on the YES or NO text that wil be selected in the dropdown list? I mean if I will select NO, we will have the normal gross salary formula calculation but if I select YES, the formula calculation will change and it will automatically generate the result with 10% deduction.

 

I don’t know if this is possible or not. I have searched everywhere but found no solution. Maybe someone will be able to help. Thank you very much! πŸ™‚


  • DreCpt 

    Let's say Net Salary is in D2 and the Yes/No for 10% Deduction is in E2. The formula for Gross Salary would be

     

    =D2*2-IF(E2="Yes",10%*D2,0)

     

    or

     

    =D2*(2-10%*(E2="Yes"))

    • DreCpt's avatar
      DreCpt
      Copper Contributor
      Thank you very much, Hans!

      Really appreciate you showed interest. This is the second time you are a real help to me.

      Best regards!

Share