How to check if text field conains 6 digits - excel

I was wondering how one would go about filtering a set of column data e.g.
BLK 123 123456
BLK 123
Basically I want to display BLK 123 123456
Any idea how i would go about doing that? Ive tried Filter Custom Filters to set more than 100000, but it wouldn't work as its a text field.
Any help?

You're trying to make some kind of regular expression, correct?
So, the answer involves something along the lines of [0-9]{6}, or \d{6} if you prefer...

This formula will check cell A1 for a match.
=MATCH(TRUE,VALUE(MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20},6))>99999)
It works by grabbing 6 characters at a time, each starting at index 1...20, converts all of them to values, then to Boolean true if the value is >= 99999, then searches for TRUE. If a match is found your string has 6 digits (somewhere in the first 26 characters).
From the title of your question I believe this was what you're asking. From the body of your question, I suppose the application of this solution would have to be the formula in another column.

Related

Single Line to Double-line Formatting in Excel

In my job I have to enter warranty information so that POs can be cut. Vendors are very particular with how this is entered and each one has their own format.
One of them requires data be entered:
SN:
MACHTYPE:
Further, the information for this is sent in a single composite number, something like:
10Y754235FUYJ9
Requiring the final input of data to be:
SN:10Y75423
MACHTYPE:UYJ9
The first 4 digits of the composite are the MACHTYPE and the final 8 are the Serial Number.
The impasse I've reached is I can't seem to get auto-fill to replicate the skipping of lines as I've formatted. It will jump a number of lines equal to however many I've selected.
Any ideas about getting it to replicate the first four Formatted Data? I've been throwing myself at this for a couple hours now.
Thanks in advance!
I think you're over complicating it by using two rows for the Formatted Data. I'd wrap the text (Home tab > Alignment section) for the cells in column F and use the following formula to insert a new line:
=CONCATENATE("SN:",B1,CHAR(10),"MATCHTYPE:",C1)
Then just leave the formatting like you had it by row...
Okay, let's focus on the title. When A1 is 10Y754235FUYJ9,
="SN:"&LEFT(A1,8)&CHAR(10)&"MATCHTYPE:"&RIGHT(A1,4)
will give you the output:
SN:10Y75423
MATCHTYPE:UYJ9
And don't forget to set the wrap text checked at Format Cells menu.

Excel Pulling Text within Cells

So I have a cell that contain this text string. I was wondering if I can pull the text between from and upon. So it captures AAA (being varying degree of length)
life insurance policy #111 111 111 for the amount of $500,000.00 from AAA upon the life of xxx
So far I only managed this:
=MID(STP_Data!D71,FIND("from",STP_Data!D71), 42)
But if the text length changes it wouldn't capture it. Also how would I not capture from within my formula. Since my currently formula will include 'from' when it is pulled. Thanks guys!
How does this work?
=Trim(SUBSTITUTE(MID(A1,SEARCH("from",A1),SEARCH("upon",A1)-SEARCH("from",A1)),"from",""))
Edit: Added TRIM() per Scott's suggestion.

How to get numbers from string in spotfire

How to extract numbers from string in spotfire ...
Example:
Input column: ACD:1234F
Output column: 1234
Help is really aprreciated
Please look at these questions you posted and accept the answers if you feel they are correct. I know for certain they are correct.
Spotfire IF Statement in Custom Expression
how to eliminate outlier in spotfire box plots
For this case, this will extract numbers. Just replace [Column1] with what ever your column is.
RXReplace([Column1],"(?!\\d).","","gis")
Column1 NumberExtract
1a2b3c4d 1234
123abc345 123345
abc123def 123
the following expression uses Regular Expressions to strip all non-numeric characters from a string:
RXReplace([col], "[^0-9]", "", "g")
some samples:
INPUT OUTPUT
abc123 123
123abc123 123123
oi3eliu2h4rli24j 3242
as you notice this will simply strip the non-numerics and combine all digits into one string. it does not account for the first or second instance of a number. if you have edge cases, you'll need to share some more data for us to help.
if this solves your issue, please don't forget to accept the answer.

Excel: generate specific length string reference

I've found some tools that can do what I want, but despite trying various options I can't work out how to put them in my existing formula!
I'm trying to generate an invoice reference number, which would look like 'ABC000012' - with the first row being ABC000001 and increasing in number as each row is added. I can currently generate 'ABC1' and so on, but can't work out how to add the preceding 0s.
I'm currently using CONCATENATE as follows:
=IF(ISBLANK(B2),,CONCATENATE("ABC",(ROW(1:1))))
What do I need to add to this, and where, in order to get the references I'm looking for?
I'm also happy to be advised that I should change the whole formula if there's something different that will work better
Thanks
Use TEXT() to set the preceding 0:
=IF(ISBLANK(B2),"",CONCATENATE("ABC",TEXT(ROW(1:1),"000000")))
=IF(ISBLANK(B2),"","ABC"&RIGHT("000000"&ROW(1:1),6))
This is based off Scott Craner's answer. The difference is that is will limit the number of digits in your invoice to 6 characters. if you want it to always be 8 characters long change the 6 to an 8 and increase the number of 0 between the " ". Alternatively you could also do:
=IF(ISBLANK(B2),"","ABC"&RIGHT(rept(0,6)&ROW(1:1),6))
In the above formula to change the number of digits n the invoice number, you would need to change both 6's
Caveat:
If there is a blank cell in the middle of your list, that number will be skipped for each blank cell. To avoid this, you will need a different counting method than row(1:1).

Format numbers in thousands (K) in Excel

In MS Excel, I would like to format a number in order to show only thousands and with 'K' in from of it,
so the number 123000 will be displayed in the cell as 123K
It is easy to format to show only thousands (123), but I'd like to add the K symbol in case the number is > 1000.
so one cell with number 123 will display 123
one cell with 123000 will show 123K
Any idea how the format Cell -> custom filters can be used?
Thanks!
Custom format
[>=1000]#,##0,"K";0
will give you:
Note the comma between the zero and the "K". To display millions or billions, use two or three commas instead.
Non-Americans take note! If you use Excel with "." as 1000 separator, you need to replace the "," with a "." in the formula, such as:
[>=1000]€ #.##0." K";[<=-1000]-€ #.##0." K";0
The code above will display € 62.123 as "€ 62 K".
[>=1000]#,##0,"K";[<=-1000]-#,##0,"K";0
teylyn's answer is great. This just adds negatives beyond -1000 following the same format.
Enter this in the custom number format field:
[>=1000]#,##0,"K€";0"€"
What that means is that if the number is greater than 1,000, display at least one digit (indicated by the zero), but no digits after the thousands place, indicated by nothing coming after the comma. Then you follow the whole thing with the string "K".
Edited to add comma and euro.
The examples above use a 'K' an uppercase k used to represent kilo or 1000. According to wiki, kilo or 1000's should be represented in lower case. So, rather than £300K, use £300k or in a code example :-
[>=1000]£#,##0,"k";[red][<=-1000]-£#,##0,"k";0
I've found the following combination that works fine for positive and negative numbers (43787200020 is transformed to 43.787.200,02 K)
[>=1000] #.##0,#0. "K";#.##0,#0. "K"

Resources