Forum Discussion

abete79's avatar
abete79
Copper Contributor
Oct 02, 2024

IF function ?

Dear All,

 

I have the following task to solve. I have variable data in one cell which used for further calculation. There are basically only two variants 30 or 60. If the value is 30 the callculation needs to be ((cell1+cell2)*2)*60, if it is 60 the calculation is cell1+cell2*60. Cell1 and cell2 independent, but the calculation depends on the given value (30 or60) in another cell. Which formula would you suggest to use?

4 Replies

  • abete79 

    This is a difference in style rather than substance.

    = 60 * (Value1+Value2) * (1 + (Variable=30))

    Using 365 it is a dynamic array formula that returns all the results in one spilt range.

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    Hi abete79 

     

    One option:

    in E3:

     

    =(B3 + C3) * 60 * IF(D3 = 30, 2, 1)

    or

    =(B3 + C3) * IF(D3 = 30, 120, 60)

     

    • abete79's avatar
      abete79
      Copper Contributor
      Thank you for your prompt response, it works
      • Lorenzo's avatar
        Lorenzo
        Silver Contributor
        You're welcome & Thanks for providing feedback