# If cell contains character, then use amount with a + or - sign

#### Rock5150

##### Board Regular
Hello all,

I have a spreadsheet where column E needs to be filled with an amount depending on whether another cell in column F has either a + or - sign.

For example:

F2 has "+ ACH PreAuthorized", G2 has "322.1". I would like to have cell E2 fill in the amount "+322.1". So in cell E2, if F2 has a plus sign, then put in the amount in E2. If it has a - sign, put in the amount from G2 into E2 but put a - sign in front of the amount. If there is no sign at all, put a zero or leave blank.

Thanks

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi,

Try,

=IF(LEFT(F2,1)="+","+"&G2,IF(LEFT(F2,1)="-","-"&G2,""))

Jai

Try putting this formula in E2...

=1*(LEFT(F2)&G2)

Try putting this formula in E2...

=1*(LEFT(F2)&G2)

A small correction in the above formula :

=1*(LEFT(F2,1)&G2)

A small correction in the above formula :

=1*(LEFT(F2,1)&G2)
You do not need to include the second argument for the LEFT function when that argument is 1 because the function defaults to 1 when its omitted (same holds true for the RIGHT function as well, but not for the MID function though). The formula I posted works fine as posted... no correction is necessary. Try it.

Replies
8
Views
280
Replies
3
Views
399
Replies
6
Views
134
Replies
5
Views
286
Replies
3
Views
369

1,203,464
Messages
6,055,573
Members
444,799
Latest member
CraigCrowhurst

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back