kalyan
kalyan

Reputation: 375

How to prefix Plus sign "+" before the number if the value is negative in Google Sheets or MS Excel?

I am trying to add/prefix a plus sign "+" if the value is negative. e.g. +10

I have sheet where some bill payments are made and sometimes they overpay. So, the Balance column should reflect like +(over paid value).

I tried with =CONCATENATE but this does not help. It comes as +-10

=IF(C2<0,CONCATENATE("+",C2),"")

enter image description here

Upvotes: 20

Views: 32749

Answers (6)

carlesgg97
carlesgg97

Reputation: 4450

You can try going to Format > Number > More formats > Custom number format and inserting the following expression: +0;-0;0

This will cause negative values to be show with a + sign, and positive ones to be shown with a - sign. The value that it holds, however, will still be the original one (as a number).

See docs (code formatting added):

When creating a custom format, note that the formatting can consist of up to 4 parts separated by semicolons: positive;negative;zero;non-numeric.

Upvotes: 44

user11982798
user11982798

Reputation: 1908

=if(C2<0, "+" & ABS(C2),  C2)

Or

=If(C2<0,"+","")&ABS(C2)

Upvotes: 1

player0
player0

Reputation: 1

all you need is this:

=IF(A2-B2<0, A2-B2*-1, )

enter image description here

then Arrayformula would be:

=ARRAYFORMULA(IF(A2:A-B2:B<0, A2:A-B2:B*-1, ))

Upvotes: 0

Dang D. Khanh
Dang D. Khanh

Reputation: 1471

Try this formula:

=SUBSTITUTE(C2,"-","+")

Upvotes: 0

Mohammed Deifallah
Mohammed Deifallah

Reputation: 1330

If you're sure that all cells will have numbers, then you may format cells to have "Number" rather than "General". Then, rewrite your condition as follows: =IF(C2<0,CONCATENATE("+", -1 * C2),"").

I hope it helps.

Upvotes: 0

MGP
MGP

Reputation: 2551

Try this formula:

=IF(C2<0,"+","")&C2

Upvotes: -1

Related Questions