Convert "CR" Into Negative Numbers

hardeep.kanwar

Well-known Member
Joined
Aug 13, 2008
Messages
693
Dear All,

I have Account Data with "DR" & "CR" Format


Excel Workbook
A
1Balance
230.00 Cr
350.00 Cr
43500.00 Cr
550.00 Cr
63300.00 Cr
73333.00 Cr
80.80 Dr
970.00 Dr
103500.00 Dr
113500.00 Dr
123312.00 Dr
1360.00 Cr
1490.00 Cr
153200.00 Cr
1684.00 Dr
1715.00 Cr
183150.00 Cr
Sheet1



What i Need to Convert "CR" Numbers Into Negative

Excel Workbook
AB
1BalanceExpected Result
230.00 Cr(300)
350.00 Cr(500)
43500.00 Cr(3500)
550.00 Cr(50)
63300.00 Cr(3300)
73333.00 Cr(3300)
80.80 Dr
970.00 Dr
103500.00 Dr
113500.00 Dr
123312.00 Dr
1360.00 Cr(600)
1490.00 Cr(90)
153200.00 Cr(3200)
1684.00 Dr
1715.00 Cr(15)
183150.00 Cr(3150)
Sheet1



Is it Possible with Formula


Thanks In Advance
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Excel 2010
AB
ValueRequired Result

<tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]26500.00 dr[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]26500.00 dr[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]125500.00 dr[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]12000.00 dr[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]45904.40 dr[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]6000.00 dr[/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]75618.40 dr[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]4000.00 Cr[/TD]
[TD="align: right"]-4000[/TD]

[TD="align: center"]10[/TD]
[TD="align: right"]810.00 dr[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"]6000.00 dr[/TD]

[TD="align: center"]12[/TD]
[TD="align: right"]100000.00 Cr[/TD]
[TD="align: right"]-100000[/TD]

[TD="align: center"]13[/TD]
[TD="align: right"]6000.00 dr[/TD]

[TD="align: center"]14[/TD]
[TD="align: right"]198540.00 dr[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]B2[/TH]
[TD="align: left"]=IF(ISNUMBER(SEARCH(" cr",Cell_Format)),A2*-1,"")[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Workbook Defined Names[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Name[/TH]
[TH="align: left"]Refers To[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]Cell_Format[/TH]
[TD="align: left"]=GET.CELL(7,INDIRECT("rc[-1]",FALSE))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Not Working for me, Please help me on how to use it..........

Actually its working in the immediate next cell only .......... please members help on this
 
Last edited:
Upvote 0
Not Working for me, Please help me on how to use it..........

Actually its working in the immediate next cell only .......... please members help on this


[table="width: 500, class: grid"]
[tr]
[td]828[/td]
[td]CR[/td]
[/tr]
[tr]
[td]830[/td]
[td]CR[/td]
[/tr]
[tr]
[td]1900[/td]
[td]DR[/td]
[/tr]
[/table]

And wanted result in column 3 so I wrote this -

=IF(B1="CR",(A1)(-1),A1)

It's returning positive value only. What is wrong in this? When I tried to debug, it converts (A1) with -1 as string.
 
Upvote 0
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]828[/TD]
[TD]CR[/TD]
[/TR]
[TR]
[TD]830[/TD]
[TD]CR[/TD]
[/TR]
[TR]
[TD]1900[/TD]
[TD]DR[/TD]
[/TR]
</tbody>[/TABLE]

And wanted result in column 3 so I wrote this -

=IF(B1="CR",(A1)(-1),A1)

It's returning positive value only. What is wrong in this? When I tried to debug, it converts (A1) with -1 as string.

Hi - try like this:


Excel 2013
ABC
1828CR-828
2830CR-830
31900DR1900
Sheet1
Cell Formulas
RangeFormula
C1=IF(B1="CR",-A1,A1)
 
Upvote 0
Hi - try like this:

Excel 2013
ABC

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #FAFAFA, align: right"]828[/TD]
[TD="bgcolor: #FAFAFA"]CR[/TD]
[TD="bgcolor: #FFFF00, align: right"]-828[/TD]

[TD="align: center"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]830[/TD]
[TD="bgcolor: #FAFAFA"]CR[/TD]
[TD="align: right"]-830[/TD]

[TD="align: center"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1900[/TD]
[TD="bgcolor: #FAFAFA"]DR[/TD]
[TD="align: right"]1900[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]C1[/TH]
[TD="align: left"]=IF(B1="CR",-A1,A1)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks - it worked. The issue was from the csv file downloaded from Bank. When I retyped numbers and CR , it worked with your formula. It had space padded. Is there quick way to remove padding.
 
Upvote 0
you might consider this formula as well

=IFERROR(-VALUE(SUBSTITUTE(A1,"Cr","")),"")

Thanks - it worked with your formula too. The issue was from the csv file downloaded from Bank. When I retyped numbers and CR , it worked with your formula. It had space padded. Is there quick way to remove padding.
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

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