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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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,214,956
Messages
6,122,465
Members
449,085
Latest member
ExcelError

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