Help - MATCH not equal to

Dannyh1

Well-known Member
Joined
Nov 18, 2009
Messages
1,144
Hi,

I have a column of cells all containing the word OUT except for 1 cell.

What is the MATCH syntax to find the cell without this word?

Many Thanks,
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Here's a UDF solution:

Worksheet syntax: =DiffWord(A1:A21,"Out")

It's set up so you can customize the word you want to use as the "right" word and will find the first deviation in the range of that word.

Code:
Function DiffWord(rng As Range, word As String) As Integer
DiffWord = 0
For Each c In rng
    DiffWord = DiffWord + 1
    If c.Value <> word Then Exit For
Next
End Function
 
Upvote 0
Hi,

I have a column of cells all containing the word OUT except for 1 cell.

What is the MATCH syntax to find the cell without this word?

Many Thanks,

Control+shift+enter, not just enter:

=MATCH(1,IF(A2:A100<>"OUT",IF(A2:A100<>"",1)),0)

yields the position of the first cell which does not house an isntance of OUT.

If you want to fetch the item of interest...

=LOOKUP(9.99999999999999E+307,IF(A2:A100="OUT","#",IF(A2:A100="","#",1)),A2:A100)
 
Upvote 0
Hi,

I have a column of cells all containing the word OUT except for 1 cell.

What is the MATCH syntax to find the cell without this word?

Many Thanks,
Is this what you had in mind...

Book1
A
2out
3out
4out
5out
6out
7out
8_
9out
10out
Sheet1

This array formula**:

=MATCH(TRUE,A2:A10<>"out",0)

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

Result = 7

The cell that does not contain "out" is the 7th cell in the range.
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,484
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top