View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default Return SEARCHED Column Number of Numeric Label and Value

Assumptions:

F10:FV10 contains the Numeric Labels

F11:V11 contains the Numeric Values

X11 contains the criteria

Formulas:

First, define the following names...

Select Y11

Insert Define Name

Name: NLabels

Refers to: =Sheet1!$F$10:$V$10

Click Add

Name: NNV

Refers to: =INDEX(NValues,Pos)+1

Click Add

Name: NValues

Refers to: =Sheet1!$F11:$V11

Click Add

Name: Pos

Refers to: =MATCH(Sheet1!$X11,NLabels,0)

Click Add

Name: SubRange

Refers to:

=INDEX(NLabels,MATCH(NNV,NValues,0)):INDEX(NLabels ,MATCH(2,1/(NValues=NNV
)))

Click Ok

*Change the sheet reference accordingly.

Then, enter the following formula in Y11, and copy down if necessary...

=IF(ISNUMBER(MATCH(NNV,NValues,0)),(MAX(IF(SubRang e<$X11,COLUMN(SubRange)
-MIN(COLUMN(SubRange))+1))+1)+(MATCH(NNV,NValues,0)-1),MATCH($X11,NLabels
,0))

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!

In article <5a5c3f52b2d1b@uwe, "Sam via OfficeKB.com" <u4102@uwe
wrote:

Extraction of previous Data Sample:

----------------------------------Col12 Col13 Col14 Col15 Col16
Row10 Numeric Label 07 13 15 10 14
Row11 Numeric Value 04 04 03 02 02

Column Number 12 Row 10 Houses Numeric Label 7
Column Number 12 Row 11 Houses Numeric Value 4

Column Number 13 Row 10 Houses Numeric Label 13
Column Number 13 Row 11 Houses Numeric Value 4

Column Number 14 Row 10 Houses Numeric Label 15
Column Number 14 Row 11 Houses Numeric Value 3

Column Number 15 Row 10 Houses Numeric Label 10
Column Number 15 Row 11 Houses Numeric Value 2

Column Number 16 Row 10 Houses Numeric Label 14
Column Number 16 Row 11 Houses Numeric Value 2

If Column Number 14 had Numeric Label 6 and Numeric Value 3 (instead of 15
and 3) then Numeric Label 14 and its new Numeric Value of 3 would be placed
in Column Number 15 because of the Ascending order requirement - 6 before 14.
BUT remembering the Numeric Values must sit in strict Descending order across
their Row - the very first SEARCH/ sort to locate where the NEW Numeric
Value will be initially placed is based on Descending order. The Numeric
Label Row will not sit in strict Ascending order because of the preferred
SEARCH/ sort (1st sort key) given to the Numeric Values. Using the larger
Sample Data in the previous Post will show that Row 10's Numeric Labels
Column Number is governed by the strict descending order of their paired
Numeric Value.

----------------------------------Col12 Col13 Col14 Col15 Col16
Row10 Numeric Label 07 13 06 10 14
Row11 Numeric Value 04 04 03 02 02

Column Number 12 Row 10 Houses Numeric Label 7
Column Number 12 Row 11 Houses Numeric Value 4

Column Number 13 Row 10 Houses Numeric Label 13
Column Number 13 Row 11 Houses Numeric Value 4

Column Number 14 Row 10 Houses Numeric Label 6
Column Number 14 Row 11 Houses Numeric Value 3

Column Number 15 Row 10 Houses Numeric Label 10
Column Number 15 Row 11 Houses Numeric Value 2

Column Number 16 Row 10 Houses Numeric Label 14
Column Number 16 Row 11 Houses Numeric Value 2

May be a better way of saying it is: if my Row of Numeric Values were all of
the same value eg: 3 and there is nothing to define or distinguish which of
the identical Numeric Values should be located in a specific Column Number,
this is the purpose of the Numeric Label. The Numeric Labels for the Numeric
Values in this case will be in strict Ascending order beacuse all the Numeric
Values are the same, that is 3.

For a Row of varying Numeric Values as in the Sample Data: the Numeric Label
will position and place itself with its Numeric Value as far as possible in
Ascending order; baring in mind the Ascending order is secondary to the
Numeric Value which will always sit in strict descending order. The Ascending
order of the Numeric Label is dependent on the strict Descending order of the
Numeric Value.

Cheers,
Sam