searching for values not in this range.

I've this array of alaphets.

Eg {"a", "d", "k")

I want to search for values NOT in the above range, what is the syntax like 
?





0
IT
6/30/2010 4:24:44 AM
windows.powershell 690 articles. 0 followers. Follow

3 Replies
1078 Views

Similar Articles

[PageSpeed] 45

On Jun 29, 9:24=A0pm, "IT STAFF" <jkk...@hotmail.com> wrote:
> I've this array of alaphets.
>
> Eg {"a", "d", "k")
>
> I want to search for values NOT in the above range, what is the syntax li=
ke
> ?

I'm assuming you're talking about single characters.  If the exclusion
range isn't overly large, then you can do this:

PS C:\Users\tojo> $exclusions =3D 'a', 'd', 'k'
PS C:\Users\tojo> $characters =3D 'a', 'b', 'c', 'd', 'e'
PS C:\Users\tojo> $characters | ?{$exclusions -notcontains $_}
b
c
e


That will output the characters that are not contained in the
exclusion list.
0
tojo2000
6/30/2010 4:42:16 AM
I cannot define $exclusions first, in another words, $exclusions can be 
"anything". User can key anything they want.

Is that a generic way to say "not within the range" defined by $characters.




"tojo2000" <tojo2000@gmail.com> wrote in message 
news:cd8b9f56-aa48-42cf-89ef-385ab1e8329c@w9g2000prn.googlegroups.com...
On Jun 29, 9:24 pm, "IT STAFF" <jkk...@hotmail.com> wrote:
> I've this array of alaphets.
>
> Eg {"a", "d", "k")
>
> I want to search for values NOT in the above range, what is the syntax 
> like
> ?

I'm assuming you're talking about single characters.  If the exclusion
range isn't overly large, then you can do this:

PS C:\Users\tojo> $exclusions = 'a', 'd', 'k'
PS C:\Users\tojo> $characters = 'a', 'b', 'c', 'd', 'e'
PS C:\Users\tojo> $characters | ?{$exclusions -notcontains $_}
b
c
e


That will output the characters that are not contained in the
exclusion list. 


0
IT
7/1/2010 2:18:56 AM
Something like this?

   $userinput = read-host -prompt "Exclusions?"
   $exclusions = $userinput -Split ''
   $exclusions = $exclusions[1..-1]
   $characters = 'a', 'b', 'c', 'd', 'e'
   $characters | ? {$exclusions -notcontains $_}

  - Larry

On 6/30/2010 9:18 PM, IT STAFF wrote:
> I cannot define $exclusions first, in another words,
 > $exclusions can be "anything". User can key anything they want.
> Is that a generic way to say "not within the range" defined by $characters.
>
>
> "tojo2000"<tojo2000@gmail.com>  wrote in message
> news:cd8b9f56-aa48-42cf-89ef-385ab1e8329c@w9g2000prn.googlegroups.com...
> On Jun 29, 9:24 pm, "IT STAFF"<jkk...@hotmail.com>  wrote:
>> I've this array of alaphets.
>>
>> Eg {"a", "d", "k")
>>
>> I want to search for values NOT in the above range, what is the syntax
>> like
>> ?
>
> I'm assuming you're talking about single characters.  If the exclusion
> range isn't overly large, then you can do this:
>
> PS C:\Users\tojo>  $exclusions = 'a', 'd', 'k'
> PS C:\Users\tojo>  $characters = 'a', 'b', 'c', 'd', 'e'
> PS C:\Users\tojo>  $characters | ?{$exclusions -notcontains $_}
> b
> c
> e
>
>
> That will output the characters that are not contained in the
> exclusion list.
>
>
0
Larry__Weiss
7/1/2010 2:59:57 AM
Reply:

Similar Artilces:

Can I abbreviate one value in a data series?
I've got a chart where one value (8,300) greatly exceeds all the others. Is there a way to abbreviate this value so the other data points show better in the graph? Hi, One way is to break the Y axis, have a look at these examples of how to http://peltiertech.com/Excel/Charts/BrokenYAxis.html http://tushar-mehta.com/excel/newsgroups/broken_y_axis/tutorial/index.html http://www.andypope.info/charts/brokencolumn.htm Cheers Andy CMEknit wrote: > I've got a chart where one value (8,300) greatly exceeds all the others. Is > there a way to abbreviate this value so the other da...

Return values that sum to a known value
I have a list of data and would like to know if there is a formula that would return any items from that list that sum to a known value. Have a look at this thread for something similar: http://www.microsoft.com/office/community/en-us/default.mspx?pg=7&cat=&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.excel.worksheet.functions&fltr= Regards, Tom "lmattern" wrote: > I have a list of data and would like to know if there is a formula that would > return any items from that list that sum to a known value. ...

Copy/paste range of rows between 2 dates...
Hi! I have a sheet called data which act as a database. The column A has the dates. In order to create customized chart in a userform, for different range of data(i.e from column D, G and M...), I'd like to select a range of rows that are between 2 dates and create the charts accordingly. Or copy to range to another sheet and then create the charts. I am not so advanced in VBA and any help would be greatly appreciated. Thanks! Greg ** Posted via: http://www.ozgrid.com Excel Templates, Training, Add-ins & Business Software Galore! Free Excel Forum http://www.ozgrid.com/forum *** Hi ...

Selecting cell value for a sum, based on a condition
Trying to come up with a formula or method that will enable me to sum values based on a condition. For example, I have three columns which contain a condition and two amounts. If the condition is of the 'each' variety, one value will be used in the sum. If the condition is of the "square foot" variety, another value will be used. Here is a small diagram that may help visualize this: A B C D 1 Measure Unit Cost S.F. Cost Summed Total 2 Each 3.00 .30 3 S.F....

ComboBox with AutoCompleteMode = SuggestAppend and custom search (Contains)?
Hi, I have a class FlightStation with a Search property that combines two attributes. I like to search not only for matching strings from the beginning, but rather from any where in the string. (With the Contains method or the string class) What is the best and quickest solution to implement such a search when using a combobox and not a TextBox for the input? I know about implementing a derived class like this: class FlightStationBindingList : BindingList<FlightStation> { // ... } But is there a more quick and dirty solution ?! - Sorry :-) My solution with the Tex...

How do I make X-values of a chart dependent on values in cells?
Greetings. I have a chart which can go from x-value 0 to x-value 200. However I'd like to be able to input min X-value into a cell, and a max X-valu into a cell, and the x-value in the chart changes to reflect that. Is it possible to do that? Thanks for any replies. K -- Message posted from http://www.ExcelForum.com Hi, There is no automatic way to do this but take a look a Tushar's AutoChart Manager for a possible solution. (http://www.tushar-mehta.com/) Cheers Andy Kashgarinn < wrote: > Greetings. > > I have a chart which can go from x-value 0 to x-value 200...

set value of a group of activex control points
Have a spreadsheet that has some 20+ activex control points (option buttons). Is there a way to group all these controls together & set their initial values the same? Trying to setup a "reset" type of operation that would clear all control points. I can do them individually via properties, but it's too time consuming. Any suggestions? ...

Altering the range that is plotted by a chart via VBA
Good morning all. I haven't really done a huge amount on charting, so I'm sure you'll think that these questions are a bit simplistic, but here goes! I plot a chart from a worksheet that contains three columns of data - the X axis contains week numbers, and is in B29:B54. Actual hours are entered in F29:F24 and cumualtive hours in G29:G24. The cumulative formula is of the form: =SUM($F$29:F29) So, each week, in order to plot another week's data, I have to copy this cumulative formula down by one cell, which, considering I have a lot of these reports, is a bit time cons...

Storing distinct values in an array
Hello .. in the speadsheet, i have a column containing a series of numbers maybe of them repeated multiple times... i would like to store all distinct values in an array any ideas on how i could do that ... eg , if these were the numbers going down column then 1 3 5 7 5 3 5 7 5 4 3 4 5 7 8 5 3 .. store 1,3,5,7,9,4,8 in an array, in no specifi order thank you shimee -- shimee ----------------------------------------------------------------------- shimeel's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1583 View this thread: http://www.excelforum.com/showt...

Populate cell with a value if another cell has a certain value
All, good morning. i have a issue, i need to populate cell E4 with a value CX/025966 when cell F4 has a text Bond Street. Is there a simple way of doin this? EXCEL 2007 Try:- =IF((F4="Bond Street"),"CX/025966","") If my comments have helped please hit Yes. Thanks. "B2ORL" wrote: > All, good morning. i have a issue, i need to populate cell E4 with a value > CX/025966 when cell F4 has a text Bond Street. > > Is there a simple way of doin this? Use IF() =IF(F4="Bond Street","CX/02...

Show zero values
When a formula returns a zero value, the zero value is not being displayed. I have reviewed the following: - conditional formatting - zero values are checked (Tools/Options/View) - stepped through my VB code (it inserts formulae based on a Worksheet Change event) - locked and hidden values unchecked with and without protection (this should have no effect when the sheet is unprotected) Are there any other circumstances that result in a zero value not being displayed? Are there any other reasons for this occurrence? Cheers John Check also normal cell formatting! there are formats that hide ...

Conditional formatting a date range
If I have a column of dates that are manual entered what is the formula to conditionally format them based on a date range of three months before the current date to the current date and another three months after the current date to the current date? Assume the dates are in column A, starting with A1. Highlight all the dates, with A1 as the active cell, and click on Format | Conditional Formatting. In the dialogue box you should select Formula Is rather than Cell Value Is and then enter this formula: =3DAND(A1>=3DTODAY()-91,A1<=3DTODAY()) Click on the Format button and choose the ...

Want to modify this procedure to have a range of periods rather than a single period
This is a multi-part message in MIME format. ------=_NextPart_000_00BF_01CB206B.89E3AC60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have the procedure below I want simply modify the periods procedure below to be -- perpost >=3D = '201001' and <=3D '201012' so I want a range of periods rather than a = single period as in the example below I would really appreciate it if someone can help me out on this. Thanks=20 Sammy USE DEMOAPP Declare @perpost nvarchar(8) /* Do not edit Above=20 ...

CButton::GetButtonStyle()
hi! is it possible that the function GetButtonStyle() returns one single style value? where can i get information when to use a mask and when to use the plain value? how about other controls/windows? actually i am a little bit confused about this... thanks, philipp "Philipp Huber" <philipp.huber@innval.com> wrote in message news:bonpkq$7hi$04$1@news.t-online.com... > hi! > > is it possible that the function GetButtonStyle() returns one single style > value? I'm not sure what you're asking, but GetButtonStyle returns the LOBYTE of the GetWindowLong/GW...

Comparing values #2
I have two sheets in a workbook. The first column in each sheet has part numbers. I would like to compare worksheet1 column a to worksheet 2 column a and identify duplicate values. I have not been able to make this work. -- Dirk Chip Pearson has lots of ways to work with duplicates/uniques at: http://www.cpearson.com/excel/duplicat.htm Dirk_Bob wrote: > > I have two sheets in a workbook. The first column in each sheet has part > numbers. > I would like to compare worksheet1 column a to worksheet 2 column a and > identify duplicate values. I have not been able to make...

Return address of first item in a range
I'm sure there must be a simple solution for this I cannot think of. I am looking for a formula that will return the value of the first item in an input range. For example, I want to put a formula in cell A10 that will return the first item that is input in the range Range A1:A9 (not nesessarily the first cell). If A4=200, A7=150 and all other cells are empty, the formula should return 200 (the first item in the column). Thanks for your assistance. Ashley Ashley, One way is to use the array formula (entered with Ctrl-Shift-Enter): =INDIRECT("A"&MIN(IF(A1:A9<...

Search Option
I have a form that contains a subform with several fields of information. I'm looking for a code that allows me to enter any type of information on the main form and have the subform search and apply a filter. Can anyone help or atleast direct me in the right direction? See: Search form - Handle many optional criteria at: http://allenbrowne.com/ser-62.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Dennis" <Dennis@discussions.micro...

Assign a value to a cell
I'll apreciate your help with this in A1 i have a value in days that is used to make several calculations but I need it to change if a specific condition is given something lik this: A1=300 If b1<a1 then a1=b1 where b1 is a value calculated somewhere else. Thank you for your help. Rodolf -- Message posted from http://www.ExcelForum.com Hi try the following formula in A1: =MIN(B1,300) Frank > I'll apreciate your help with this > > in A1 i have a value in days that is used to make several > calculations, but I need it to change if a specific condition is > giv...

Cntl Key move/select to change in value
Just another convenience key sequence to make my life easier. Sure, maybe I could do it with a macro. But, it seems like a nice little obvious addition to regular functionality. Cntl-Alt down arrow moves you down to where the value changes. Cntl-alt-shift selects to change. Up, down, right, left of course. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the s...

IF statement with FALSE value being text AND cell reference? #3
Once again, figured it out on my own. Oh, and thanks for the repl Frank. Needed to use the ROUND function: =IF(D9>1,D9*D8,"<" & ROUND((D9*D10),2) -- jcob ----------------------------------------------------------------------- jcob2's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1560 View this thread: http://www.excelforum.com/showthread.php?threadid=27157 ...

Update cell based on date range
Hey guys! I was wondering if I could get some help here. I would lik to update a cell based on a date range. For example, I would like t update the value of a cell to the value of another cell if the curren date is between July 1st and July 10th. However, if the date i outside the date range, I want the value for that cell to not b updated, and be the previous value. Can anyone give me an example a to how I would do this? Thanks!! -- deversol ----------------------------------------------------------------------- deversole's Profile: http://www.excelforum.com/member.php?action=geti...

Check for Values
Hi I have 2 tables, requirements and stock on hand. In the requirement table, I have a part number, qty and due date and a related record in the stock on hand table using part number showing current stock. My question is can I use a query (and how!) to tell me a) I have enough stock to fulfil the requirements and b) If not at what date will I not be able to fulfil the requirements and by how many? Have been working on this for a while, and cant work it out Regards Alec Alec You are there, we are not ... the following may not fit your situation ... If you have a [Par...

Chart templates treates value axis as a category axis
I saved a Chart Template [Line Plot Type] that uses a horizontal value axis, but when I try to use it in a new workbook, the data is plotted with a horizontal category axis? In a line chart, the horizontal (X) axis IS a category axis. Only an XY chart has a value horizontal axis. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services, Inc. http://PeltierTech.com/WordPress/ _______ "FHW at EAD" <FHW at EAD@discussions.microsoft.com> wrote in message news:E52B4E4C-9DC6-41F5-84B2-3BC637C56591@microsoft.com... >I saved a Chart Template [Line Plot Type]...

Save only values of one sheet
Hi, If I save a workbook as .CSV, Excel only saves the values of the current sheet in a *.CSV-file. Can I do EXACTLY the same - saving only values of the current sheet - in an *.XLS file (and of course in an XLS-format!). Eventually, formatting elements (like background and font colors) may also be saved. Thanks for any help. Anja. Just copy the sheet to a new workbook (right-click on the sheet tab, select Move or Copy from the menu, select (new book) from the To book dropdown, and check the Create a copy option, then OK), and save that new workbook. -- HTH RP (remove nothere from the...

Sorting Search Results
I there a way to sort search results to see the messages with the latest responses first? Thanks, ...