Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default How to return a specific data point from a large array if I don't know the exact location?

Hi,

I have an Excel question and I'm not sure if I'm approaching it
correctly. I have a column of data (C7:C8398) which is all text and I
need to return the value given 3 conditions so I wrote the following
array.

=IF((A7:A8398=P7)*(K7:K8398=Q7)*(M7:M8398=0),C7:C 8398,FALSE)

The value is a unique data point (e.g., there is only 1 data point in
the entire column that satisfies all 3 conditions). For example, let's
say the answer is "test". I don't know how to retrieve the value that
I want because the result of the array would be: [FALSE, FALSE, FALSE,
...., "test", FALSE, FALSE...]

I tried using INDEX/MATCH functions but I think that requires me to
know what the answer is. I don't know the answer is "test". I have a
whole column of answers (e.g., C7:C8398) but I don't know the answer
that will satisfy the conditions.

Any ideas? Am I approaching this incorrectly?

Thanks in advance,
Stuart

  #3   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default How to return a specific data point from a large array if I don't

Try also, array-entered (press CTRL+SHIFT+ENTER):
=INDEX(C7:C8398,MATCH(1,(A7:A8398=P7)*(K7:K8398=Q7 )*(M7:M8398=0),0))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
" wrote:

Hi,

I have an Excel question and I'm not sure if I'm approaching it
correctly. I have a column of data (C7:C8398) which is all text and I
need to return the value given 3 conditions so I wrote the following
array.

=IF((A7:A8398=P7)*(K7:K8398=Q7)*(M7:M8398=0),C7:C 8398,FALSE)

The value is a unique data point (e.g., there is only 1 data point in
the entire column that satisfies all 3 conditions). For example, let's
say the answer is "test". I don't know how to retrieve the value that
I want because the result of the array would be: [FALSE, FALSE, FALSE,
...., "test", FALSE, FALSE...]

I tried using INDEX/MATCH functions but I think that requires me to
know what the answer is. I don't know the answer is "test". I have a
whole column of answers (e.g., C7:C8398) but I don't know the answer
that will satisfy the conditions.

Any ideas? Am I approaching this incorrectly?

Thanks in advance,
Stuart


  #4   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default How to return a specific data point from a large array if I don't know the exact location?

Public Function GetAnswer() As String
For i = 7 To 8398
If Sheet1.Range("A" & i).Value = Sheet1.Range("P7").Value Then
If Sheet1.Range("K" & i).Value = Sheet1.Range("Q7").Value Then
If Sheet1.Range("M" & i).Value 0 Then
GetAnswer = Sheet1.Range("C" & i).Value
Exit For
End If
End If
End If
Next i
End Function

This is how to do that

Go to ToolsMacroVisualBasic Editor
then Right click on the VBAProject, select INSERTModule

then paste the code above in the coding area

Back to your excel sheet.

Goto to A1 then on the menu click Insert Functions

On the insert function dialog, in the category select User define
function
and in the function list select GetAnswer

Hope u understand my instruction.

  #5   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default How to return a specific data point from a large array if I don't know the exact location?

thank you all for your help!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting a new line when external data changes Rental Man Excel Discussion (Misc queries) 0 January 11th 06 07:05 PM
Match Closest Results from Data Array TheRobsterUK Excel Discussion (Misc queries) 2 September 29th 05 01:48 PM
Help with data not getting plotted Scott Ehrlich Charts and Charting in Excel 1 January 23rd 05 05:15 PM
Extending a Chart Data Series from an Array - Can it be done? Jon Peltier Charts and Charting in Excel 4 November 30th 04 03:30 AM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"