Help with Formula OR VBA code

Jagat Pavasia

Active Member
Joined
Mar 9, 2015
Messages
359
Office Version
  1. 2021
Platform
  1. Windows
dear sir,

I have Main amount figure in my A6 and want to less B6 & C6, and then answer in D6.

but my B6 and C6 have some suffix in (), so please help me.
I attached photo, please find it.


I want answer in D6 which is yellow highlighted in Imag
1.JPG



in example my answer is 714.35
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hello Jagat,

One Option is like below

Book1
ABCD
5Main AmountLess 1Less 2Answer
6800.0025.01 (D-255)60.64 (N-23)714.35
Sheet1
Cell Formulas
RangeFormula
D6D6=A6-MID(B6,1,SEARCH("(",B6)-1)-MID(C6,1,SEARCH("(",C6)-1)
 
Upvote 0
Another option could be:
Excel Formula:
=$A6-LEFT($B6,SEARCH("(",$B6)-1)-LEFT($C6,SEARCH("(",$C6)-1)
 
Upvote 0
Hello Jagat,

One Option is like below

Book1
ABCD
5Main AmountLess 1Less 2Answer
6800.0025.01 (D-255)60.64 (N-23)714.35
Sheet1
Cell Formulas
RangeFormula
D6D6=A6-MID(B6,1,SEARCH("(",B6)-1)-MID(C6,1,SEARCH("(",C6)-1)
thank you sir, it is working as i need

thank you again
 
Upvote 0
You are welcome & thanks for the feedback
dear sir,


Capture.JPG





If my B6 and C6 have not suffix () then it did not work,
please add something and tell me new formula.

it should be either blank, either only digit like 25.02, either with suffix like 25.02 (D-223
 
Upvote 0
Excel Formula:
=$A6-IF(ISNUMBER(SEARCH("(",$B6)),LEFT($B6,SEARCH("(",$B6)-1),$B6)-IF(ISNUMBER(SEARCH("(",$C6)),LEFT($C6,SEARCH("(",$C6)-1),$C6)
 
Upvote 0
If my B6 and C6 have not suffix () then it did not work,
please add something and tell me new formula.

it should be either blank, either only digit like 25.02, either with suffix like 25.02 (D-223
You can try like @Flashbond suggested in Post # 7 or like below which is a bit shorter
Excel Formula:
=A6-IF(ISTEXT(B6),MID(B6,1,SEARCH("(",B6)-1),B6)-IF(ISTEXT(C6),MID(C6,1,SEARCH("(",C6)-1),C6)
 
Upvote 0
Solution
Hi, just another option..

Book1
ABCD
5Main AmountLess 1Less 2Answer
680025.01 (D-255)60.64 (N-23)714.35
780025.0160.64 (N-23)714.35
880025.01 (D-255)60.64714.35
980025.0160.64714.35
10800800
1125.01 (D-255)60.64-85.65
120
Sheet1
Cell Formulas
RangeFormula
D6:D12D6=A6-LEFT(B6&"0",FIND(" ",B6&" "))-LEFT(C6&"0",FIND(" ",C6&" "))
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

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