View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default returning header row as a result...

Still does not work!

--
AP

"Domenic" a écrit dans le message de
...
The 'match type' or third argument for the MATCH function is missing
and, as a result, defaults to 1. You need to set it to 0 for an exact
match.

Also, the 'height' specified for the OFFSET function will add a row to
your reference/range, i.e. A2:D11.

So, your formula should be amended as follows...

=INDEX(A1:D1,MATCH(1,COUNTIF(OFFSET(A2:D10,,COLUMN (A:D)-COLUMN(A:A),9,1),
$F$2),0))

But, personally, I prefer the following...

=INDEX(A1:D1,MATCH(TRUE,COUNTIF(OFFSET(A2:D10,,COL UMN(A2:D10)-COLUMN(A2),
,1),$F$2)0,0))

Two reasons:

1) If by mistake, there's a duplicate entry for one of the columns, the
formula will still return a correct result.

2) By omitting the '9' and leaving the 'height' for the OFFSET function
empty, it automatically defaults to the height of the reference, i.e.
A2:D10 --- 9.

3) Personally, I think it looks better. But to each his/her own... :)

Hope this helps!

In article ,
"Ardus Petus" wrote:

Incorrect result.
Here is my sample sheet:

http://cjoint.com/?desg77Wwr1

HTH
--
AP
"Domenic" a écrit dans le message de
...
In article ,
"Ardus Petus" wrote:

Does not work either. I wonder why!

Are you getting an incorrect result? Or are you getting an error

value?
Note that the formula needs to be confirmed with CONTROL+SHIFT+ENTER,
not just ENTER.

In other words, enter the formula but instead of pressing just ENTER
hold the CONTROL and SHIFT keys down, then while they're pressed down,
press the ENTER key. Excel will automatically place braces {} around
the formula indicating that you've entered the formula correctly.