Forum Discussion

riveter2's avatar
riveter2
Copper Contributor
Jun 07, 2017

Nested If function with multiple criteria

In the IF statement =IF(C36>D36,(SUM(D36-C36)),(SUM(D36-C36))) In the 2nd SUM area I want to put the word "Credit" after the result of D36-C36. How can I do this?  I am currently using Office 2007. Thank you

3 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Bit more to previous posts. Yes, as always in Excel you may usually receive result by few different ways.

    First, you may simply add the text to number like

    = D36- C36 & IF(D36>C36, " Credit",)

    Side effects here are

    - result will be the text and you can't work with it as the number

    - if in previous cells you have some calculations final representation could be not friendly. For example, if you apply above approach to the cell with =10000/3 you will receive something like

    3333.333333333 Credit

     However, that could be corrected by TEXT() function.

     

     

    Second approach, you may simply apply custom formatting (use Ctrl+1) for the cell with =D36-C36 like

    #,##0.00 " Credit";#,##0.00

    Result will be the number, thus you always may continue your calculations with such cell (e.g. balance) and

    it always proper formatted like

    3,333.33 Credit

     

     

     

     

     

     

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor
    Hi,

    You may use formula =C36-D36 and apply custom format to this cell adding word Credit to positive numbers and nothing to negative.

    I'm on mobile and it's bit hard to give exact details, you may Google "Excel custom formatting" or like

Resources