Forum Discussion

Oliullah_Siddique's avatar
Oliullah_Siddique
Brass Contributor
Jun 26, 2022
Solved

Excel Formula

Hello,

I need the following formula. 

Thanks a lot.

 

Result B2  C2 Formula Criteria
Operating profit            1,000            1,000If B2 & C2 are positive, formula will show Operating profit
Operating loss         (1,000)         (1,000)If B2 & C2 are negative, formula will show Operating loss
Operating profit/(loss)            1,000         (1,000)If B2 positive & C2 negative, formula will show Operating profit/(loss)
Operating (loss)/profit         (1,000)            1,000If B2 negative & C2 positive, formula will show Operating (loss)/profit
  • Hi Oliullah_Siddique 

    Assuming Excel 2019, 2021 or 365 you could do this with https://support.microsoft.com/en-us/office/ifs-function-36329a26-37b2-467c-972b-4a39bd951d45

     

    in A2

    =IFS(
        AND(B2 > 0, C2 > 0), "Operation profit",
        AND(B2 < 0, C2 < 0), "Operation loss",
        AND(B2 > 0, C2 < 0), "Operation profit/(loss)",
        AND(B2 < 0, C2 > 0), "Operation (loss)/profit",
        TRUE, "Other"
    )

8 Replies

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    Hi Oliullah_Siddique 

    Assuming Excel 2019, 2021 or 365 you could do this with https://support.microsoft.com/en-us/office/ifs-function-36329a26-37b2-467c-972b-4a39bd951d45

     

    in A2

    =IFS(
        AND(B2 > 0, C2 > 0), "Operation profit",
        AND(B2 < 0, C2 < 0), "Operation loss",
        AND(B2 > 0, C2 < 0), "Operation profit/(loss)",
        AND(B2 < 0, C2 > 0), "Operation (loss)/profit",
        TRUE, "Other"
    )
      • Lorenzo's avatar
        Lorenzo
        Silver Contributor
        Glad we could help. To help others who search this site could you click on the Mark as response link at the bottom of one of the options you got please ? Thanks

Resources