extracting digits from non-numerical number code

bigdan

Well-known Member
Joined
Oct 5, 2009
Messages
846
Office Version
  1. 2013
Platform
  1. Windows
I have a Company Code, 4 digits, and a Profit Center, 7 digits hyphenated.
Eg CC 5500, PC 5500-123

The CC’s 4 digits typically start the PC’s 7 digits, but not always. I created a formula to extract the PC’s first 4, [ =LEFT(C9,4) ] and then compared that to the CC, so that the ones that didn’t match would be flagged. But this didn’t even work on the first line, where the numbers were the same. I’m guessing this is a text to number issue? Please help.

I know the numbers didnt match btw b/c I evaluated the formula and the if condition eval'd as false.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
suppose your data is in A1 in b1 type this formula and check with various combinations

=IF(MID(A1,SEARCH("CC",A1)+3,4)=MID(A1,SEARCH("PC",A1)+3,4),"flagged","")
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

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