Question: I have XAML code for Image control look like this:

```
Image x:Name="test" local:TiltEffect.IsTiltEnabled="True"  HorizontalAlignment="Left" Height="200" Margin="95,300,0,0" VerticalAlignment="Top" Width="150" Source="/Assets/20121215_082027.jpg"/>

```

Now how can i write this code in csharp.I have dynamically created image control.

Answer: 
You can use a so-called array formula to achieve this. As an illustration, I simulated your situation in this image:

![Excel picture of situation](https://i.stack.imgur.com/MxcWb.png)

The important cell is `H1`, which contains the index of the offending cell in column `E`. For the sake of simplicity, I introduced two named ranges `items`, containing cells `E1:E9` and `lookup` containing cells `K2:K10`. The formula in `H1` is

```
=MAX(IF(ISBLANK(items),0,IF(ISERROR(MATCH(items,lookup,0)),ROW(INDIRECT("1:"&ROWS(items))),0)))

```

This is an array formula, which means that you have to confirm with `Ctrl`-`Shift`-`Enter`. If you did that right, the formula will show curly brackets around it -- you do not type those yourself. This formula goes over all cells in the range called `items`, creates an array with the value 0 for all cells that are blank or that have a match in the range called `lookup`. For the remaining cells, the value inserted is equal to the row number. Then the maximum is taken over that.

As a result, `H1` will contain the index of the last offending item. If all items are OK, then the value 0 is displayed.

Cell `G1` shows `Error` if any offending item has been found, and `OK` otherwise. The formula is

```
=IF(H1=0,"OK","Error")

```

Finally, `I1` displays the actual offending item via

```
=IF(H1>0,INDEX(items,H1),"")

```

If you do not want to use the named ranges, then replace `items` with `$E$1:$E$9` and `lookup` with `$K$2:$K$10`.

If the offending cell is an empty cell, then `I1` will contain the value 0.

I think the value in `H1` is useful for analysis, but if you do not want it, you can hide it. Or you can fold that formula in the ones used in `G1` and `I1`, but the formulas become pretty complicated.

A workbook containing this answer is uploaded [here](http://temp-share.com/show/dPf3LyuHW)

As a note on the side: are you aware that you can use Excel's data validation feature with a drop-down list to avoid these kinds of typos you are looking at. That might be useful for you. An example is given in the article [Drop-Down Using Data Validation in Microsoft Excel](http://www.officearticles.com/excel/drop-down_using_data_validation_in_microsoft_excel.htm)
The Easiest way to do this is; to use the filter "Does not contain"

Excel 2010 solution, similar for 2003

* Select the whole column
* Select Data
* Select Filter
* Select filter option (triangle at top of column)
* Select text filters
* Select Does not contain
* Enter type
* Modify and rerun as needed.