If length of characters in cell is greater than 6, report first 4 characters of the cell....Help pls

SB1976

New Member
Joined
Sep 8, 2016
Messages
4
Hi,

Im trying to write a formula in excel;

If length of characters in cell is greater than 6, I'd like to report the first 4 characters of the cell.

Ive been trying combinations like the following but I'm struggling! =IF(LEN(AF15)>6,"left(AF10, 4)","False")

Thank you
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Just remove the quotes around the left statement and make sure that you are referencing the same cell. I noticed you are checking the length of AF15 but then pulling the left 4 characters from cell AF10.


Excel 2010
AB
1StringResult
215f78yr15f7
3123abFalse
Sheet1
Cell Formulas
RangeFormula
B2=IF(LEN(A2)>6,LEFT(A2,4),"False")
 
Last edited:
Upvote 0
Glad to help. You had the right idea. Just remember to only use the quotes if that is what you want to show. For example (if A1=15f78yr), ="LEFT(A1,4)" will return LEFT(A1,4) while =LEFT(A1,4) will return 15f7.
 
Upvote 0

Forum statistics

Threads
1,222,617
Messages
6,167,074
Members
452,094
Latest member
Roberto Saveru

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