Forum Discussion
Excel formula assistance
I have a sheet that I import a daily ticket report from our corporate server. This report is unformatted and I have created a worksheet that I extract only the fields that I need. One field (Packing List #) is a numeric field. This field generally consists of 8 digits. I have used an IF statement (=IF(LEN($A3)=8,IFERROR(VALUE(LEFT($A3,6),IFERROR(VALUE(TRIM(LEFT($A3,5))))) for a field on the worksheet that extracts all the packing list # except for the last two digits. The formula works if there are 8 digits. If it is less than 8, I need to extract the digits minus the last two. If there are less than 8 digits the term FALSE is returned which is should, but I need the actual digits returned so the formula in this cell can extract data from another field. I have included a screen shot of the worksheet.
Thank you in advance. Any help/suggestions would be appreciated.
7 Replies
- Charla74Iron ContributorI’m not able to get to a computer but try below:
=IF(LEN($A3)>=8,IFERROR(VALUE(LEFT($A3,6),IFERROR(VALUE(TRIM(LEFT($A3,LEN($A3)-2)))))- TeachASU2020Copper Contributor
Charla74 I get a response that I have entered too few arguments.
- Charla74Iron ContributorI can figure it out properly in front of a machine but seems it might need the result if false; how about this:
=IFERROR(IF(LEN($A3)>=8,VALUE(LEFT($A3,6),VALUE(TRIM(LEFT($A3,LEN($A3)-2))))),FALSE),””)
- mathetesGold Contributor
A picture may be worth a thousand words, but in the excel techcommunity a spreadsheet (sample) is worth even more. Could you upload such a sample...it's truly a lot more productive to work with that, than with an image, because there may be things not visible in the image that are affecting your results. Thanks
- TeachASU2020Copper Contributor
mathetes I have attached a sample of my spreadsheet. I do appreciate the assistance.
- TeachASU2020Copper Contributor
TeachASU2020 This is an older spreadsheet that I have been using. An associate of mine and I created the macros and formulas. He did most of the formulas that is why the code looks a little crazy. I was attempting to modify his code to get it to pull the correct number of digits regardless if there are 5 or 8 digits.