Formula to move trailing minus

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,601
Office Version
  1. 2021
Platform
  1. Windows
I have the following value in col K 7,837.52-

I have tried using the formula

=IFERROR(VALUE(RIGHT(K63,1)&LEFT(K63,FIND("-",K63)-1)),VALUE(K63))

To remove the trailing minus and to put it in front of the value, but I get #value!

I have shown sample data below. It would be appreciated if you could assist me

Excel Workbook
KLM
637,837.52-24#VALUE!
641,381.68-24#VALUE!
651 389.5525-1 389.55
Sheet1
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Try:
M63: =IF(RIGHT(K63,1)="-",(-1)*VALUE(LEFT(K63,FIND("-",K63)-1)),VALUE(K63))
 
Upvote 0
Instead of a formula, try

Highlight the column of numbers
Click Data - Text to columns
Select Deliminated
Finish
 
Upvote 0
Hi Guys

Thanks for the reply. I still get #value!. However, If I remove the , from 7,837.52- then the formula give me the correct value.

I would like a macro that will format the data that contains a trailing minus in col K correctly

For eg 7,837.52- must be formated as (7 837.52)

See sample data below


Excel Workbook
KLM
637,837.52-24#VALUE!
641,381.68-24#VALUE!
651 389.5525-1 389.55
Sheet1
 
Upvote 0
Hi Jen

Thanks for the reply. Your formula is formatting the data correctly. However, when I try to sum the data in Col M , it gives me 0.00

It would be appreciated if you could assist me

Excel Workbook
KLM
637,837.52-24(7 837.52)
641,381.68-24(1 381.68)
651 389.5525-1389.55
Sheet1
 
Upvote 0
That formula converted to text. Try this formula
Code:
=IF(RIGHT(A1,1)="-",-1*(SUBSTITUTE(A1,"-","")),A1)

With this custom format
Code:
# ##0.00;(# ##0.00)
 
Upvote 0
Hi Jen

Thanks for the help, much appreciated

Regards

Howard
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top