Forum Discussion

LFM123's avatar
LFM123
Copper Contributor
Apr 30, 2024

Sign in front of number

Hello. Is it possible to make a "-" sign in front of all the numbers that says sell, instead of inserting it manually for all the numbers?

 

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    LFM123 

    You can do this with Conditional Formatting.

    • Go to the Home tab and click Conditional Formatting.
    • Select New Rule.
    • Select Use formula to determine which cells to format.
    • Enter the following formula:

    =A2="SELL"

    • Click Format and select the Number tab.
    • Go to the Number tab and select Custom.
    • In the Type field, enter the following custom formatting:

    "-"0

    • Click OK.

    Now the values ​​in column B will be displayed with a minus sign right in front of them if the corresponding cell in column A contains the word "SELL".

    Attached is an inserted file with the steps and formulas described above.

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

    Was the answer useful? Mark as best response and Like it!

    This will help all forum participants.

  • LFM123 

    Don't forget that NikolinoDE 's solution will only change the appearance of the table, not its actual content.  To use the quantities within further formulas you would need to define the quantity array to be

    quantity
    = IF(buySell="sell", 1, -1) * unsigned

     

Resources