is it possible to custom filter in Excel so that I get the data that contain INC followed by a series of number? (numbers vary)
I would like to get data like:
Request raised (INC12460031)
email sent in order to set up SNOW ticket INC12168408
Excluding the following examples: INCorrect, INConvenience etc.
(...)37 hours are mentioned which seems to be incorrect.
Please accept our apologies for all the inconvenience caused.
You can achieve that with an Advanced Filter.
The formula in E2 excludes items where the character following "INC" isn't a number greater than 0. Observe that the created MidString has a length of only one character. You could increase that number even to the point of including the entire word. Such an increase would ensure that numbers starting with zero aren't excluded.
Trying to write a custom data validation formula that would only allow values in the following format: 2-digit year (this can be just 2 numbers), dash ("-"), then a 1 or 2 letter character(s) (would prefer upper case, but would settle for lower case), another dash ("-"), and then a 5-digit number. So the final value looks like: 17-FL-12345 ...or 16-G-00008...
I actually have a but more, but if I could get the above working, that would be terrific. I don't know if there's a way, but it would be great if additionally I could use custom formatting to get the dashes to appear when they are not entered, i.e., user enters "17FL12345" and it gets automatically formatted to "17-FL-12345". Finally, again, this isn't a deal breaker either, but it would also be great if the last 5 digits would add any leading zero's, i.e., the user enters 17-G-8 (or just 17G8) and it gets formatted to 17-G-00008.
Can't use VBA unfortunately. Some potential solutions to similar questions I've viewed include:
https://www.mrexcel.com/forum/excel-questions/615799-data-validation-mixed-numeric-text-formula-only.html
Data VAlidation - Text Length & Character Type
Excel : Data Validation, how to force the user to enter a string that is 2 char long?
Try this:
=AND(ISNUMBER(VALUE(LEFT(A1,2))),MID(A1,3,1)="-",OR(ISNUMBER(FIND(MID(A1,4,1),$C$1)),AND(ISNUMBER(FIND(MID(A1,4,1),$C$1)),ISNUMBER(FIND(MID(A1,5,1),$C$1)))),MID(A1,LEN(A1)-5,1)="-",ISNUMBER(VALUE(RIGHT(A1,5))),OR(LEN(A1)=11,LEN(A1)=10),LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))=2,LEN(A1)-LEN(SUBSTITUTE(A1,"+",""))=0,LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=0)
Assuming, you want to validate A1. I inserted the letters in C1.
Edit:
I edited the original function, to be more secure and left out the Isnumber part and rather went digit by digit.
If you want exceed the 255 limit, you have to slice the function up.
I created 5 functions.
=AND(ISNUMBER(FIND(LEFT(A1),$C$2)),ISNUMBER(FIND(MID(A1,2,1),$C$2)))
=MID(A1,3,1)="-"
=IF(LEN(A1)=10,AND(ISNUMBER(FIND(MID(A1,4,1),$C$1)),MID(A1,5,1)="-"),IF(LEN(A1)=11,AND(ISNUMBER(FIND(MID(A1,4,1),$C$1)),ISNUMBER(FIND(MID(A1,5,1),$C$1)))))
=IF(LEN(A1)=10,MID(A1,5,1)="-",IF(LEN(A1)=11,MID(A1,6,1)="-"))
=IF(LEN(A1)=10,AND(ISNUMBER(FIND(MID(A1,6,1),$C$2)),ISNUMBER(FIND(MID(A1,7,1),$C$2)),ISNUMBER(FIND(MID(A1,8,1),$C$2)),ISNUMBER(FIND(MID(A1,9,1),$C$2)),ISNUMBER(FIND(MID(A1,10,1),$C$2))),IF(LEN(A1)=11,AND(ISNUMBER(FIND(MID(A1,7,1),$C$2)),ISNUMBER(FIND(MID(A1,8,1),$C$2)),ISNUMBER(FIND(MID(A1,9,1),$C$2)),ISNUMBER(FIND(MID(A1,10,1),$C$2)),ISNUMBER(FIND(MID(A1,11,1),$C$2)))))
Set up data validation as on the picture:
I have a SharePoint list with a field, Field A, holding values such as "Text-11" or "DifferentText-150" and I want a new calculated field, Field B, that only shows the numeric part of Field A (i.e. "11", "150").
The number can be between 1 and 9999 so I canĀ“t take always the last 2 digits.
Does anyone have an idea how to realize that with the calculated field function of SharePoint?
You will need to use several different functions to accomplish this. Your primary function will be MID which will allow you to grab a part of the original text but then you will also need to use SEARCH for your starting point and LEN to get the correct number of characters. Here are the steps for making your formula:
You will need the index of the first character in the number. This can be achieved by finding the first character after the dash ('-'). Remember that indexes in SharePoint calculated fields start at 1 and not 0.
SEARCH("-",[Title],1)
Next you need to get the length of the number part of your string. This can be achieved by getting the length of the whole string and subtracting the index of the dash ('-').
LEN([Title]) - SEARCH("-",[Title],1)
Finally you can get the number part of the string by using the MID function and passing in the index of the first character in the number (Part 1) and the length of the number part (Part 2).
MID([Title],SEARCH("-",[Title],1) + 1,LEN([Title]) - SEARCH("-",[Title],1))
Note: Title is just the name of the test column that I used.
I have a Purchase Order form which I need to calculate any entered values automatically (for totals, tax etc). Problem is, some of these fields in the InfoPath form have their default values as a calculation for this purpose. Fine.. but the problem then arises when a line is blank (there are 12 lines in the form but not all may be used in one PO). If a line is blank then the calculated fields will of course, display 'NaN'. For example the Quantity and Price fields are multiplied to make the total, then the total is multiplied by the tax percentage to get the net total. I attach a screenshot below for ease of understanding:
This is fine when it's line 1, as line 1 will definitely be filled in, but not for the others. See line 6 as a demo which is causing this problem. I have tried no default and '0' in the static fields, but neither works unless I put in an integer in (which then confuses users). The form validation insists that a number is in the number fields (not 'NaN'), so is there any way I can either ignore that on form validation, or find another workaround to solve this issue?
For reference, the calculations input as the default value for these are as follows:
Quantity: 0
Price per item: 0
Pre-tax price: Line6Quantity * Line6Price
VAT: (Line6Total - Line6SubTotal) / Line6Total
Line total: Line6SubTotal * (1 + Line6VAT)
As you can see, the VAT/Line Total fields are designed to be interchangeable, so people can fill in either/or. The form is being filled in from SharePoint.
Hope this all makes sense; help much appreciated.
You can make an easy workaround by checking the value in a function called before the form is submitted. So add an onClick="checkForNaN()" function to your submit form.
The isNaN() function should come in handy as you scan through the input boxes to check whether they evaluate to NaN. If so, simply change them to something acceptable to your form validation code.
I have a situation where user enters a number of length 9 digits. But some people will only enter three digits like 901. So when they enter three digits in the text box, i have to auto generate the rest of the 6 digits and insert it into the database. I should check this against data base table that what was the last auto generated number with 901 and insert next value to it.
I just need a suggestion not the complete solution, that i should do this c# or SQL. Which is the best way to do it.
Thanks
A few things. As Tim mentioned, seems the system should provide the user with the number, not the user providing the system with the number. At any rate you'll want to use a database which would at the least contain a series of primary keys [http://en.wikipedia.org/wiki/Unique_key] (numbers not to be duplicated). Se the key to auto increment. This will ensure no other user has the same number/id.