VBA Replacement For Index And Small Function
May 10, 2012
I compile ratings for racehorses and am currently extracting the data I need using an array formula. Unfortunately there are are many thousands of lines of data and it can take quite some time for the data to pull through.
Here is a sample of the formula's I am currently using. I cannot take credit for the formulas by the way I found them on the web.
IF(ISERROR(INDEX('Database 2012'!$A$1:$B$300,SMALL(IF('Database 2012'!$A$1:$A$300=Ratings!$A3,ROW('Database 2012'!$A$1:$A$300)),1),2)),"",INDEX('Database 2012'!$A$1:$B$300,SMALL(IF('Database 2012'!$A$1:$A$300=Ratings!$A3,ROW('Database 2012'!$A$1:$A$300)),1),2))
Basically I have 2 sheets (Database 2012, Database 2011) with the horse names with ratings next to them for each run, One sheet for this season one for last season.
These are sorted in date order. then I have a ratings sheet that shows the horse name and then to the right it has columns for each of its last 4 ratings.
The formulas I use look for the horse name on the database sheet then put the rating in latest rating in the first column then the 2nd latest in the next column and so on until the last 4 ratings are shown. If there are not 4 ratings to find the is an iserror at the beginning of the formula to populate that cell with a blank so that the errors dont show.
What I want to know is there a way of doing what the formula does using VBA and more importantly would it be quicker than using array formulas which are very slow to recalculate when there are 1000's of lines.
View 4 Replies
ADVERTISEMENT
Dec 9, 2009
Please see the attached worksheet for details. I would like the array function to search for instances of the word "FALSE" in column E and return the values of columns A:D when a match is found. I have done this successfully when the lookup value is a value in the first column of the range, but cannot seem to do so when the lookup value is in the last column of the range. I have received a #NUM! error each time.
View 9 Replies
View Related
Feb 1, 2010
I'm creating a report that pulls certain record entries from another worksheet (Activity) in the same book. Originally, it only pulled one type of activity. "SO". Now I need it to pull "SO", "CC" and "BT" type activities into the same report. Currently my formula looks like this and works fine for only looking for the "SO" type:
View 2 Replies
View Related
May 15, 2014
I have an equation below that work great except when row 2 has a duplicate value. When this happen row 5 only return the first value in row 1 and not the other duplicated values.
=INDEX($B$1:$AF$1,MATCH(SMALL($B$2:$AF$2,COLUMN(B$1)-1),$B$2:$R$2,0))
see attachment. How can I have row 5 return the following value: B5 = A, C6 = B and D5 = C.
View 2 Replies
View Related
Feb 16, 2014
I have a Pivot table (see picture) and in another field I want to be able to type in the Month and Year (e.g. January 2012) and return the worst performer of the 8 suppliers. I have been trying to use SMALL in conjunction with INDEX(MATCH(MATCH)) but it doesn't appear to be working.
I am sure there is a simple solution but it is evading me at the moment.
excel.jpg
This is where I am at with the formula. Maybe I can use the IF function somehow?
=INDEX('Pivot Tables'!B19:I19,MATCH(Summary!G3,'Pivot Tables'!A20:A41,0),
MATCH(SMALL('Pivot Tables'!B20:I41,A5),'Pivot Tables'!B20:I41,0))
View 4 Replies
View Related
Dec 10, 2008
I have the formula (found in cell "C2") on the Report sheet. I need to perform a function, but I cannot get it to work on the sheet I need to pull information from. The sheet RecapWk12 has a small section pasted (with some cells edited for obvious reasons) from the actual workbook. I can get the formula in Report cell (A10) to work on pulling information from sheet2. You can see I am getting (#REF!) in cell C2.
View 3 Replies
View Related
Sep 15, 2014
I have one data tab which constantly changes. (adding more products and corresponding volume/prices) For the lookup tab, I want to look up one value and return multiple values.
I have figured out an index array formula but it just calculates so slowly. My live file is about 8MB now. When I apply my formula, it takes forever to save.
View 7 Replies
View Related
Jan 18, 2014
I'm using this formula to lookup data based on the lowest average.
[Code] .....
The problem is that the minimum average is a two way tie, and I need to return both data sets. It just happens to have the same average.
I've tried using SMALL(array,1) and SMALL(array,2) in place of MIN above, but it gives me the same data set. I've also tried resizing using offset.
See attached : sample.xls‎
View 6 Replies
View Related
May 19, 2014
Here is a code for me to print the names in ascending order even if values are of same means it is showing one name only instead of the other name
means if values are A=1 B=2 C=3 D=4 E=2
it has to show like this A B E C D
But the result is coming like this A B B C D
Formula which i used
=OFFSET(B$6,MATCH(SMALL(C$6:C$18,ROW()-ROW(C$6)+1),C$6:C$18,0)-1,0)test.xls
Here i am attaching the sample file for your reference
View 10 Replies
View Related
Jun 23, 2009
I'd like to use the SMALL() function in excel to pull out the second lowest unique value in a list, but I'm not sure there is a way to do this. For example, if the array is {1,1,3,10,2,6}, then SMALL(array,2) returns 1, but I'd like it to return 2. Is there a way I can modify this function or use a different one to achieve what I want?
View 4 Replies
View Related
Jan 19, 2010
I have the G column listed with number from 1-100. On the B column I have the corresponde titles for each number in G.
What I want to do is =Look at the G(1:100) take the top 10 lowest value and write the correspondant title nearby.
I think it s possible with Min or Small functions, but I dont know how to, especially taking the title names nearby.
View 9 Replies
View Related
Jan 21, 2014
Criteria:
U4= 12/01/2013
Data:
(A) (B) (C)
01/01/2013 02/01/2013 12/01/2013
1 3 4
2 2 1
4 1 1
Result:
Small - looking for smallest to fifth smallest (separate cells B5=1, B6=2 etc.)
View 1 Replies
View Related
Feb 17, 2012
Suppose you have a dates mix in column A with year-month-day format, for example:
ABC12012-04-27Call to the Doctor at 9am
22012-05-13Chicago Concert
32012-04-14Buy ticket to theater
42012-05-03Take children to match
52012-04-07George birthday
62012-04-21Bring the car to inspection
7
And in Column C you want to get the first or the third date of a month, for example for April
View 2 Replies
View Related
Sep 3, 2009
I have a column of number that I want to use the Small & Large function on, skipping duplicates.
Example:
Column A has the following numbers;
1
6
1
4
3
2
4
6
17
8
21
8
10
13
I want the Small function to identify the first lowest number (1) and then the second lowest number (2), not (1) again.
View 9 Replies
View Related
Apr 21, 2009
I have a Big Question about the SMALL Function in Excel. I would like to know if it is possible to use a syntax that will make the small function update my graph dynamically.
Personnel transfer out of the Department on know dates... but they come in to the Department all the time. I would like to know if I can increase the "range of my data" even if I don't have data in the cells (i.e. B2:B6 have data, I want the range to include B7:B16, which has no data)... When I have no data in the cells I get errors/ circular references...
Ideally, I would like be able to add or remove personnel and the SMALL function would "organize/update" my graph dynamically. Is this possible?
View 6 Replies
View Related
Mar 20, 2009
Another interesting dilemma to solve. Using this formula:
View 2 Replies
View Related
Dec 3, 2013
let me start by saying that I know an example workbook would be useful here, but the part I'm struggling with is the [managementroster.xlsm] file, and there is A. no way I can release it to the internets and B. its so huge/complicated I couldn't even begin to reproduce a portion of it, scrubbed of data, and hope to maintain its functionality in a meaningful manner.
[Code]....
This formula checks a staff number on this spreadsheet, and then goes and looks at the staff number on the roster. Once found, it returns that staff members roster, but changes any manager codes in the MRC list to Mgr, and changes all other roster codes to Free.
I now need this formula, before altering roster codes to Mgr or Free, to only return codes that are a match for another table (or after really. I don't particularly care, so long as only codes are shown that match data from another table). I think an index/match function would do the trick, but this forumula is already at the edge of my excel ability, nesting another function within it is completey beyond me. The relevant cells for the index/match function would be:
This first Match function targets the column. $E3 is the date required, $BA$1:$DN$1 is the range the dates are entered in
Match: Lookup value = $E3
Lookup array = '[ManagementRoster.xlsm]Vacancies!'$BA$1:$DN$1
match type = 0
This second Match function targets the row. $A$4 is the department name, $B$434:$B$452 is the range where all departments are entered
Match: Lookup value = $A$4
Lookup Array = '[ManagementRoster.xlsm]Vacancies!'$B$434:$B$452
match type = 0
Index: array = $BA$434:$DN$452
So I think my final function is
[Code] .....
But I have absolutely NO idea where it would fit within my first formula, or how to code it so that my original formula only reproduces results that are found in both sheets, or anything.
View 2 Replies
View Related
Aug 20, 2014
How do I add a space between these 2 =Index functions
=INDEX(Customer!G$1:G$5,MATCH($C$35,Customer!$A$1:$A$5,0))&INDEX(Customer!H$1:H$5,MATCH($C$35,Customer!$A$1:$A$5,0))
As its displaying an address like this currently
22Newtonroad and I want 22 Newton Road
View 3 Replies
View Related
Feb 13, 2009
My formula is: = INDEX (Lastsales,$022,$S$5)
O22 is blank
S5 =1
I am not getting an error message. I am getting data that is in Lastsales in column 1, row 19. What is Excel using for the row since $O22 was a blank?
View 14 Replies
View Related
Jan 27, 2010
I tried with the VLookup, and HLookup and neither one worked for me. I have a reference table with all the data, and then input sheet where I want to bring this data by using one of the excel function. ie. When I enter office name on the top of the input page, I would like the Tax ID # in cell C3 to fill in using the excel function from the data on the reference tab. Same with cell C14 & C15. see attached for an example.
View 5 Replies
View Related
Mar 24, 2013
I've been working on a payroll program for my small biz. I'm close to done BUT...When I use the Index Match function in a cell it works great. However I need to copy it down a column to work for pay periods going forward. When I copy it down of course it puts zeros or N/A.
Columns:
Gross Fed FICA Medicare State Net
F G H I J K
Gross is user input. FICA Medicare State and Net are simply calculated on the sheet. But to get Fed Income tax I use the Index Match function and it works perfectly. The rows increment properly with each new user input.
My question: Fed Income tax is dependent on what the Gross is in order to look up the tables with the Index Match function. How do I get the result of the function into column G? Can I increment up Column G and ignore the zeros that dragging the function down G creates?
View 1 Replies
View Related
Jul 9, 2009
I am trying to sum values on sheet1 in column CR using the index function, but it comes up as #ref!
see formula below
=INDEX(Sheet1!1593:1609,96)
View 9 Replies
View Related
Apr 15, 2009
I have a formula to get unique values from a column....Can anyone help me to re write with the funcations in attached file...
Formula...
=IF(ROW()-3>$B$22,"",VLOOKUP(ROW()-3,$B$4:$C$22,2,FALSE))
Macro is not allowed...
View 10 Replies
View Related
Feb 13, 2014
I have attached a sheet with what I am trying to accomplish...
I have several records that I am doing a lookup through. Most records have the same "work order number". As you can see on the attached sheet, my lookup function returns all the work order numbers that match my criteria.
What I need is to only return the first instance of the work order number then return the next unique work order number that meets my criteria.
Attachment 297239!
View 3 Replies
View Related
Feb 27, 2014
I would like to have an Index & match function in my userform.
I know that i must use it like this Application.WorksheetFunction but i am not able to do it.
User select a code and then in next text boxes, description and price should appear.
View 6 Replies
View Related
Jul 4, 2009
I am working on a spreadsheet which contains a number of reference data sheets (named “Reference data 2009”, “Reference data 2010” etc). As their names suggest, these sheets contain reference data applicable to the particular year. This reference data is used to perform various calculations in a “Calculations” sheet.
On the “Calculations” sheet, the user specifies the year for which they wish to perform calculations. At present, I am using the volatile INDIRECT function to perform various HLOOKUP calculations along the following lines:
=IF(D15>=HLOOKUP('Detailed net pay calculations'!D16, INDIRECT("'Reference data" & 'Detailed method'!$C$2 & 'Detailed net pay calculations'!D1 & "'!$B$43:$Y$52"), 4, FALSE), “Do something”, “Do something else”)
The reason I'm using the INDIRECT function is to identify the sheet with the appropriate year (hence "Reference data"&'Detailed method'!$C$2&'Detailed net pay calculations'!D1 which could be interpreted by Excel as "'Reference data 2009NEW" or "'Reference data 2010", depending on whether there's text in cell D1).
My query
The function I'm using is working perfectly fine but I am wondering if it is possible to replace the INDIRECT function (in red) with INDEX or another non-volatile function in order to reduce the performance impact (I have a fairly large number of these types of functions).
View 2 Replies
View Related
Jul 13, 2009
I'm looking for the reason why the following use of the INDEX function returns a cell address [ie the formula evaluates SUM($C$2:C3)]-
View 5 Replies
View Related
Jan 30, 2003
Is there a way to use the INDEX function to return Blanks or NAs instead of zeros when the corresponding row & column match is a blank/null cell?
e.g. =INDEX(F10:H13,1,1) returns 0 even if cell F10 is blank?
View 9 Replies
View Related
Mar 31, 2012
I have different worksheets to contains information from different years. To make it comphrensve, I have created a mastersheet which contains all the info across the worksheets. And once I make an entry in the worksheet, I hope the mastersheet can be updated automatically. the function I set is
INDEX('2011-12'!K$4:K$7,MATCH(Master!$B5,'2011-12'!$B$4:$B$7,0),1).
Yet, my problem is..... once I perform sorting in the mastersheet, the cells are wrongly matched. So, I just wonder how I can revise the function?
View 2 Replies
View Related
Sep 27, 2012
I am trying to use index & match function to extract data from data base with has multiple critera in rows as well as cloumns but it is not giving correct results.
Example:
A
B
C
D
E
[Code].....
In C9 I typed =INDEX($B$2:$E$6,MATCH($A9,$B$1:$E$1,0),MATCH($B9,$A$2:$A$6,0))
The result I got was #Ref!
what formula should I use in C9 to get 20, C10 to get 5 & so on
FB1 to FB4 are column headers (critera)
GL 1 to GL5 are row headers (critera)
View 2 Replies
View Related