Hi Everyone,
I have truck ids that comes through the ledger with their appropriate sales and purchase dollars. The dollars should offset when a sale and purchase IDs are the same. However, the issues i'm running into is spaces in between, zeros in between, letters in the beginning and letters in the end for these truck IDs.
I use the 2 formulas below to help but it is not capturing everything.
Formula 1 - To remove all the D in front.
Formula 2 - To remove extra spaces in between.
[TABLE="width: 800"]
<tbody>[TR]
[TD][/TD]
[TD]Truck IDs[/TD]
[TD]Formula 1[/TD]
[TD]Formula 2[/TD]
[TD]Problems[/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]ACL123[/TD]
[TD]ACL123[/TD]
[TD][/TD]
[TD]Letter in the Front[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*ACL123[/TD]
[TD]ACL123[/TD]
[TD][/TD]
[TD]Letter in the Front[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]ABC 329[/TD]
[TD]ABC 329[/TD]
[TD]ABC329[/TD]
[TD]Letter in the Front and SPACE - No Match[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*ABC329[/TD]
[TD]ABC329[/TD]
[TD]ABC329[/TD]
[TD]Letter in the Front and SPACE - No Match[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]ABC 35060B[/TD]
[TD]ABC 35060B[/TD]
[TD]ABC35060B[/TD]
[TD]Letter in the Front, SPACE and LETTER B - No Match[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*ABC35060[/TD]
[TD]ABC35060[/TD]
[TD]ABC35060[/TD]
[TD]Letter in the Front, SPACE and LETTER B - No Match[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]PVHC20B[/TD]
[TD]PVHC20B[/TD]
[TD]PVHC20B[/TD]
[TD]Letter in the Front and in the end - No Match[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*PVHC20[/TD]
[TD]PVHC20[/TD]
[TD]PVHC20[/TD]
[TD]Letter in the Front and in the end - No Match[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]CC 01116[/TD]
[TD]CC 01116[/TD]
[TD]CC01116[/TD]
[TD]Letter in the Front, SPACE and ZERO in between[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*CC1116[/TD]
[TD]CC1116[/TD]
[TD]CC1116[/TD]
[TD]Letter in the Front, SPACE and ZERO in between[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]GOPV 036B[/TD]
[TD]GOPV 036B[/TD]
[TD]GOPV036B[/TD]
[TD]Letter in the Front, SPACE, ZERO IN BETWEEN (need to remove B)[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*GOPV36B[/TD]
[TD]GOPV36B[/TD]
[TD]GOPV36B[/TD]
[TD]Letter in the Front, SPACE, ZERO IN BETWEEN (need to remove B)[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]PVBL0099[/TD]
[TD]PVBL0099[/TD]
[TD]PVBL0099[/TD]
[TD]Letter in the Front, Zeros in Between[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*PVBL99[/TD]
[TD]PVBL99[/TD]
[TD]PVBL99[/TD]
[TD]Letter in the Front, Zeros in Between[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thank you.
Please delete my other "Formula Needed" topic. I submitted this again as my original topic was not loading probably. My apologizes.
I have truck ids that comes through the ledger with their appropriate sales and purchase dollars. The dollars should offset when a sale and purchase IDs are the same. However, the issues i'm running into is spaces in between, zeros in between, letters in the beginning and letters in the end for these truck IDs.
I use the 2 formulas below to help but it is not capturing everything.
Formula 1 - To remove all the D in front.
Code:
=IF(LEFT(B2,2)="D*",RIGHT(B2,LEN(B2)-2),IF(RIGHT(B2,1)="D",LEFT(B2,LEN(B2)-1),B2))
Formula 2 - To remove extra spaces in between.
Code:
=SUBSTITUTE(C8," ","")
[TABLE="width: 800"]
<tbody>[TR]
[TD][/TD]
[TD]Truck IDs[/TD]
[TD]Formula 1[/TD]
[TD]Formula 2[/TD]
[TD]Problems[/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]ACL123[/TD]
[TD]ACL123[/TD]
[TD][/TD]
[TD]Letter in the Front[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*ACL123[/TD]
[TD]ACL123[/TD]
[TD][/TD]
[TD]Letter in the Front[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]ABC 329[/TD]
[TD]ABC 329[/TD]
[TD]ABC329[/TD]
[TD]Letter in the Front and SPACE - No Match[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*ABC329[/TD]
[TD]ABC329[/TD]
[TD]ABC329[/TD]
[TD]Letter in the Front and SPACE - No Match[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]ABC 35060B[/TD]
[TD]ABC 35060B[/TD]
[TD]ABC35060B[/TD]
[TD]Letter in the Front, SPACE and LETTER B - No Match[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*ABC35060[/TD]
[TD]ABC35060[/TD]
[TD]ABC35060[/TD]
[TD]Letter in the Front, SPACE and LETTER B - No Match[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]PVHC20B[/TD]
[TD]PVHC20B[/TD]
[TD]PVHC20B[/TD]
[TD]Letter in the Front and in the end - No Match[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*PVHC20[/TD]
[TD]PVHC20[/TD]
[TD]PVHC20[/TD]
[TD]Letter in the Front and in the end - No Match[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]CC 01116[/TD]
[TD]CC 01116[/TD]
[TD]CC01116[/TD]
[TD]Letter in the Front, SPACE and ZERO in between[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*CC1116[/TD]
[TD]CC1116[/TD]
[TD]CC1116[/TD]
[TD]Letter in the Front, SPACE and ZERO in between[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]GOPV 036B[/TD]
[TD]GOPV 036B[/TD]
[TD]GOPV036B[/TD]
[TD]Letter in the Front, SPACE, ZERO IN BETWEEN (need to remove B)[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*GOPV36B[/TD]
[TD]GOPV36B[/TD]
[TD]GOPV36B[/TD]
[TD]Letter in the Front, SPACE, ZERO IN BETWEEN (need to remove B)[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sale[/TD]
[TD]PVBL0099[/TD]
[TD]PVBL0099[/TD]
[TD]PVBL0099[/TD]
[TD]Letter in the Front, Zeros in Between[/TD]
[/TR]
[TR]
[TD]Purch[/TD]
[TD]D*PVBL99[/TD]
[TD]PVBL99[/TD]
[TD]PVBL99[/TD]
[TD]Letter in the Front, Zeros in Between[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thank you.
Please delete my other "Formula Needed" topic. I submitted this again as my original topic was not loading probably. My apologizes.
Last edited: