Forum Discussion
Need help with formula IF,ISNUMBER
Is there a way to extract only the numbers that are together when I know the starting position, and I can just change the starting position where the numbers appear differently, but the exact number of digits will be either 4 or 5. ***And as I write this I read below and this is what is done!***
I will try the aggregate solution below and see if it works! Thank you!
Hi Mike,
The formula extracts first set of continuous digits in the string. I bit simplified it using the idea described here http://www.excelhowto.com/how-to-find-the-first-number-in-a-text-string-use-excel-formula/
=AGGREGATE(14,6,--MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW(INDIRECT("1:"&LEN(A1)))),1)
To your number you may apply custom format (Ctrl+1) like this
[>9999]0"ft" 00"inch x" 0"ft" 0"inch";0"ft" 0"inch x" 0"ft" 0"inch"
but that's only as example, I don't know real logic of your numbers. More about custom number formats is here (first what found) http://simoncpage.co.uk/blog/2008/09/excel-custom-and-conditional-number-formatting/
Result looks like
and attached
- Mike EmberleyMay 10, 2018Copper Contributor
The Aggregate function formula worked like a charm, thank you very much. I tried the other "mid" formula and that also worked to a point. Could you explain the logic that excel uses in the Find(char(row fields, as I tried changing it to a1 to a319 to include the whole data set, but it displayed a blank, all the way to A49. From A50 through A56 it displayed a 1, from A57 and higher it worked as expected. I've attached the spreadsheet if needed.
=MID(A3, AGGREGATE(15,6,FIND({1,2,3,4,5,6,7,8,9,0},A3),1), AGGREGATE(15,6, FIND(CHAR(ROW($A$58:$A$126)), RIGHT(A3, LEN(A3)-AGGREGATE(15,6,FIND({1,2,3,4,5,6,7,8,9,0},A3),1) +1) ),1 )-1 )