Remove last 5 digits of a number? (I have a partially working formula)

Marq

Well-known Member
Joined
Dec 13, 2004
Messages
914
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Using 365

I have a column that will have either a 15 digit number or "<NONE>" without the quotes.

I want to have a column next to it with a formula basically saying:

If the cell has 15 digits, then remove only the last 5 digits.....and if it has <NONE> in the cell then populate it with WORK

for example in column AG cells I will have something like this:

123456789101112
<NONE>

in column AH I want it to show up as:

1234567891
WORKED

I am using this to remove the last 5 digits : =LEFT(AG3,LEN(AG3)-5)

I cant figure out how to get the WORKED to show up for the <NONE>
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Like this?

Book1
AGAH
11234567891011121234567891
2<NONE>WORKED
Sheet1
Cell Formulas
RangeFormula
AH1:AH2AH1=IF(AG1="<NONE>","WORKED",LEFT(AG1,LEN(AG1)-5))
 
Upvote 0
Solution
How about
Excel Formula:
=if(len(AG3)=15,left(AG3,10),"WORK")
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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