Lookup Function That Can Return Value From Array
Apr 11, 2014
I need a look-up function that can return a value from an array that can be 3 to 7 rows in height. I want the function to always look at the last row in the array.
This is how it looks:
Column A Column B
blank row
1000
A
B
C
SUM 15
blank row
In this case I want the function to return 15 if I search for 1000. The problem is that there are not always a fixed number of rows beneath the searched value.
View 1 Replies
ADVERTISEMENT
Aug 5, 2013
I have a grid like follows (how to format):
2013-08-16-5.00 0 0
2013-08-16-2.0-19,902 -20,734 -21,429
2013-08-16-1.011,431 11,907 12,297
2013-08-160.0-0 0 -11
2013-08-161.0111 153 140
2013-08-162.031 61 60
[Code]...
Basically I want to return an array (to pass to another function) containing all data that matches my search. E.g. I want to retrieve an array of the data that matches 2013-09-20. Is the only way to do this a VBA func?
View 5 Replies
View Related
Apr 12, 2013
I would like to write a formula to return a value from a column that relates to an array within which my lookup value exists. See the tables below:
ID
V1
V2
V3
105
27
3
149
[Code] .......
The tables above are on different sheets within a workbook. I would like to write a formula that returns the "ID" numbers from column "A" in the first table, based on values in columns B-D in that first table, into column "C" in the second table. For example, in this case, the ID number that corresponds with the value "12491" would be "109", since 12491 corresponds with 109 in the first table.
FYI, the "Value" numbers in the second table are calculated based on their rank (high-low) within the matrix in the first table.
I tried the INDEX-MATCH function, but it doesn't seem to work if I'm trying to find a value within a 2-D array- it only works if I'm looking in a single column.
View 2 Replies
View Related
Mar 8, 2007
I have two columns of data, one containing Groups, another containing Items. Like this:
Group | Item
A | Apple
A | Orange
B | Pear
B | Banana
C | Tire
D | Coffee
etc.
On another sheet, I have each of the groups listed as column headings. I want to resort the data and display it in columns instead of in a single list.
I can write a VLOOKUP to search for "B" for example, and return "Pear", but I want to return all matches for "B" not just the first one.
View 2 Replies
View Related
Jan 18, 2010
In the attached sheet, I want to look up values from table (A1:G5) and then for each occurrence of a particular number, return the value in the same row in column H, and sum when there are multiple values (see green shaded area for desired output. For example, the number 8 occurs in E3, E4, and G5. I want to return the sum of the corresponding values in column H (1,5, and 2). I've spent hours trying to work this one out, I'm sure this is probably an array formula, but I can't manage to make it work.
View 3 Replies
View Related
May 30, 2006
I know something very similar was posted before, but unfortunately, it wasn't what I was looking for. I have a Worksheet tracking several associates and the department they have done work in. (Our associates are contractors for other departments). I need to have a final worksheet that allows me to pull up a name, and display every dept they worked with in the past week.
View 9 Replies
View Related
Mar 13, 2014
I have a list of ID Numbers and Dates. Let's call this "List 1".
I also have a second list "List 2" which also contains a list of ID Numbers and Dates as well as a third column for Rating.
I am trying to extract the Rating for each ID Number from List 2 and display in List 1. The problem is that the Rating can change with time, so List 2 contains several different Date and Rating values for the same ID Number.
What I need to do is lookup the ID Number from List 1 and return from List 2, for that ID Number, the Rating at the closest date prior to the date for that ID Number in List 1. Example below:
List 1
List 2
ID Number
Date
Rating
111
17/04/13
5
[Code] ..........
View 9 Replies
View Related
Jun 23, 2014
I have the following data; B1 and B2 are entered by the user and are named 'heat' and 'race' respectively. Conditional Array Formula Example.xlsx I'm after the ROW number that matches the minimum time (col C) for the heat and race combination shown - in the example below (heat: A, race: 100m), I'd like row '5' returned (or, better still, row '2' of the array A4:D11), as that's the lowest time for Heat A, 100m.
A
B
C
D
[Code].....
but this dosesn't exactly seem elegant, and doesn't work!
ie I simply want the row number (ideally relative to the range) for the lowest time for any given inputs 'Race' and 'Heat'.
View 3 Replies
View Related
Jan 3, 2008
I am trying to write a function that returns a single dimension array from inputed data. I want this to work for any data, i.e. a single cell, an array in vba or a range. I am using the "for each" staement. However, when I pass an array in the "for each" returns the same range, rather than the elements of the range. I've played around a bit, and the "for each" does what I want on an range if I am not passing the range to a function. Is it because I am passing the range into a function as a variant? Here is the code for the function.
Public Function CreateSingleDimensionArray(ByVal dataToConvert) As Variant
Dim vHolder As Variant
Dim vArray As Variant
Dim lElementCount As Long
lElementCount = 0
For Each vHolder In dataToConvert
lElementCount = lElementCount + 1
Redim vArray(1 To lElementCount)
vArray(lElementCount) = vHolder
Next vHolder
CreateSingleDimensionArray = vArray
End Function
View 4 Replies
View Related
May 8, 2013
I need to find a way to find an array in a tab to use for an index/match function I have.
this is what i would normally use: =index(tab_array,match($a2, tab!$a$1:$a$1000,0),match($B$1,tab!$a$1:$zz$1,0))
This formula would usually work fine when I know that within the tab, the array in which the row match is searching doesn't change. However, that array may change in the future, to say column H, without my knowing as it is a database that gets automatically populated from an upstream system.
Is there a way to search for an array within an index/match?
View 1 Replies
View Related
Apr 24, 2007
I have a list with 8 columns. In the majority of instances, Columns A & B will have duplicate information. I need to be able to search columns A & B & return the information from them PLUS all info contained on the same row's from columns C/D/E/F/G & H. EG:...
My column headings are as follows...
Type Region Contact Phone Email ADD1 ADD2 ADD3
In column A (type) would be the type of contact eg:business/personal/family etc.
So... If looking for family I'd need excel to show me the region, contact, phone, email, add1, add2 & add3 for each family record. Hope this makes sense!
There are over 1000 records i need excel to search through & return matches.
I'm an intermediate excel user at best so finding it complicated. Tried vlookup but that stops when it finds a match & anything else seems over my head.
View 9 Replies
View Related
Apr 3, 2012
Use look up to check batches of data a return a value dependent of multiple ifs?
I have this formula from here
=LOOKUP(COUNTIF(C4:C7,""&0),{0,1,2,3},{19.9,29.9,39.9,49.9})
What I am trying to achieve is using the above can it check
C4:C7 Grouped and named "first"
C8:C10 Grouped and named "second"
C11:C13 Grouped and named "third"
If one from each group is selected it returns 1 value, if 2 of each are selected it returns a second value and if 3 of each are selected it returns a third value?
I thought by grouping them it may give me the desired results but all it does is change if I select more than one from any of the groups.
View 2 Replies
View Related
Jul 3, 2009
I am performing a lookup using the populare user defined function nlookup, which does not take a lookuparray argument to find lookup values. But I only want to return lookup values that fall into a certain array. To accomplish this, I figured out that I need a way to specify a condition of the type "if cell address of lookup value falls within range"
It should be possible if I find a way to return the cell address of the nlookup value, but as nlookup is not limited by a lookuparray argument, so I was not able to use the address/index/match that come up in similar questions.
View 3 Replies
View Related
Jan 10, 2014
Assume you have a rectangular range. Say A1:M18. There are values in some random cells (any number of cells) within the range. The rest of cells are blank. In cell M19 (ie cell below the bottom right corner of the range), I need a excel function that returns the nearest (ie physical location) non blank cell value. I have searched the internet for weeks. The closest formula is the following (see below) but it is flawed as it returns zero if there are values in rows below the row of the nearest cell with non blank...and also zero if there is value in a column greater than the column of the nearest cell with non blank.
Closest formula so far:
INDEX(A1:M18,LARGE(IF(ISBLANK(A1:M18),"",ROW(A1:M18)),1)-ROW(A1:M18)+1,LARGE(IF(ISBLANK(A1:M18),"",COLUMN(A1:M18)),1)-COLUMN(A1:M18)+1).
And the function should be relative not absolute as the range can be extended..but the location of the formula remain same relative to the array size. (ie. always at below the right bottom cell).
NOTE: Ignore the special case where two non blank cells are the nearest. That will not happen.
View 5 Replies
View Related
Jan 26, 2010
I need to figure out how to match three values on the "source info.xls" file attached to the "PFG FILE.xls" that is also attached. In column A in the "Source info.xls" file the formula will need to match the yellow column, then the green column, then the red column. keep in mind that the attached files are just a small subset of data. The "PFG File.XLS" is actually 150K rows long.
View 5 Replies
View Related
Jan 2, 2009
I have a workbook with 2 different types of sheet - 1 containing source data and the others 'collecting' data from the source sheet, depending on what the sheet is for.
For example, the data source contains different pets, their names, ages and their owners.
The other sheets are on a one-per-owner basis.
What I would like to do is use a LOOKUP / MATCH function to lookup the owner name typed in cell A1 of the output sheet and match it with the corresponding owner name(s) on the source sheet. I would then like it to return with each pet and append the results on the sheet accordingly - like below:
John Smith (in cell A1)
Pet - Name - Age
-------------------
Dog - Rover - 3
Goldfish - Tom - 1
Gerbil - Chewit - 4
View 7 Replies
View Related
Jun 12, 2009
I am trying to perform a lookup (vlookup) function in a cell in excel and wish to have the range as a variable, so that I can adjust which column the lookup function refers to.
View 4 Replies
View Related
Feb 21, 2009
Assuming 1st row is a header row
Sheet1, Column A
1230000_XL07 - WB OPS
1230001_XL08 - WB OPS
1230002_XL09 - WB OPS
Sheet 2, Column A
1230000
How do I lookup 1230000 and return 1230000_XL -07 WB OPS in B2
View 2 Replies
View Related
Feb 11, 2008
I'm trying to use an array to carry out string function on a range of excel cells.
Here is the code I am using
Dim arrXl As Variant
arrXl = ws.Range("F1:F" & ws.Range("D1").End(xlDown).Row)
For i = LBound(arrXl) To UBound(arrXl)
MsgBox (LBound(arrXl))
'If 1st char is different from 3rd char then remove all of string after 1st char
If Left(arrXl(i), 1) <> Mid(arrXl(i), 3, 1) Then
arrXl(i) = Left(arrXl(i), 1)
End If
'If 1st char is different from 7th char then delete string after 5th char
If Left(arrXl(i), 1) <> Mid(arrXl(i), 7, 1) Then
arrXl(i) = Left(arrXl(i), 5)
End If
The lbound function returns the value of 1 as the lower bound, I do not have "Option base 1" set so I was expecting the lbound value to be 0. The first 2 cells in the F column are blank so this may have something to do with it, I am unsure if cells in excel can be null if they can be null one cell may be null and the other may be a zero length string but I am unsure about this.
The ubound function returns a value of 487.
The code breaks when I try to access an element in the array so it breaks on the line:
If Left(arrXl(i), 1) <> Mid(arrXl(i), 3, 1) Then
and returns the "Subscript out of range" error message.
View 5 Replies
View Related
Jul 29, 2008
I am trying to use lookup function to lookup for data in another table (we call it table A). Unfortunately, whenever the code is not in the table A, Excel will return the data from the previous row.... is there any possible way to prevent this... in another word, if the code does not exist in the table A, I want Excel to return 0 or some other figures.
View 9 Replies
View Related
Aug 6, 2009
I need to multiply an array of logical results ( returned as {1,0,0,0,1,0 et.}) with a text array (a reference column) and return the text in the reference column in case the value in the logical array is 1.
View 3 Replies
View Related
May 14, 2013
Function Haversine has correct value in debugger but in cell it has the same value as Haversine2. Is this a known bug?
Public Function Haversine(lat1 As Double, long1 As Double, lat2 As Double, long2 As Double) As Double
Dim temp As Double
[Code]....
View 9 Replies
View Related
Apr 18, 2008
Is it possible to set up a lookup function with two lookup values? For example, say I have a list of items such as:
1 A 14
1 B 22
2 C 84
4 D 25
I'd like to have the lookup go to the above table and find the number 1 and the letter B and return 22. I can't seem to visualize how to make this work.
View 9 Replies
View Related
May 16, 2014
untitled 1.JPG
i want result "z" in b1 in all three condition of attachment
View 3 Replies
View Related
May 15, 2014
A b c d
100 100 x
100 y
100 z
I want to lookup 100 in colum b with a result of z instead of x in criteria c:d
View 2 Replies
View Related
Jul 14, 2014
I am trying to write a function that will look up values in an array, and then return a value from a separate array. where:
Column A has a name and dates:..Column B has a number associated with the date (0 or 1)
"John" ..............................................0
6/1 ..............................................0
6/2 ..............................................1
6/3... ..............................................0
6/30 ..............................................1
I am trying to make a summary table that shows the dates associated with each time "1" occurs
So it will look like:
column C: ...... Column D: ...... Column E:......Column F:
John.................6/2...............6/30............... N/A
Bill ............... 6/1...............6/2............... 6/30
Fred ...............N/A ...............N/A...............N/A
and so on:
I've tried excel formulas, but can't get the right date returned.
View 2 Replies
View Related
Feb 12, 2008
The formula you see below works great. It will lookup to the closest value that matches the criteria.
=LOOKUP(2*F2-0.000000000001,C1:C4+C2:C5,D2:D5)
Here is the problem when I try to expand the range I get a zero.
=LOOKUP(2*F2-0.000000000001,C1:C19+C2:C20,D2:D20)
Is there anyway we could overcome this?
I know I could use a formula array for this, but I would like to know if this could be done in a non-array formula ....
View 9 Replies
View Related
Jun 6, 2007
I'm using an Array formula to lookup a particular value then return a related column value.
What I would like to do is Sum a related range of cells.
The formula I have used to look up the single cell is
{=INDEX('[PL.xls]Parts List'!A4:S205,MATCH(A63,'[PL.xls]Parts List'!A4:A205,0),7)}
So in this case the related value in column 7 is returned.
I would like to sum the related values in say columns 5 to 11
View 4 Replies
View Related
Jun 9, 2014
I have attached a worksheet which I need to show the last update and last date customer contacted, The formula :
=LOOKUP(2,1/($F2=Data!$D$1:$D$10000)/(Data!$B$1:$B$10000=MAX(IF(($F3=Data!$D$1:$D$10000)*(Data!$M$1:$M$10000=COUNTIF($F$2:$F3,$F3)),Data!$B$1:$B$10000))),Data!B$1:B$10000)
is used to output the last contact and the formula contained within column Av, Both of which contain #N/A
View 4 Replies
View Related
Mar 4, 2007
I have 40 or so case studies on one worksheet. Each case has four columns- the first is the year, and the next three are values for that year. Each study is 140 years long, but they don't all start in the same year. What I want to do is pluck all the values from the fourth column of each study, and total them up for each year.
View 9 Replies
View Related