I recently took over this spreadsheet from someone who left the company. Formula in T column:
=INDEX(BFTable, MATCH(1, (UPPER(LEFT(ST, 2))=$E$1:$E$315)*
(ProcessingDate>=$A$1:$A$315)*(ProcessingDate<=$B$1:$B$315)*
(EffectiveDate>=$C$1:$C$315)*(EffectiveDate<=$D$1:$D$315)*
($AI3=$P$1:$P$315)*($F$1:$F$315="HM"),0),COLUMN()-COLUMN($T$2)+1)
Could someone explain to me what this formula is trying to do? What is ST? The output is the same with processing date in A column. There is no BFTable, although the tab name is BF.
Thanks,
SC
The pieces BFTable and ST are probably named ranges.
What the formula does is look up in the range BFTable the row associated with the MATCH(...) part and the column given by COLUMN()-COLUMN($T$2)+1.
The MATCH section is a long conditional. It searches for the first case where all of the following conditions are true and returns the index of that row:
UPPER(LEFT(ST, 2))=$E$1:$E$315
ProcessingDate>=$A$1:$A$315
ProcessingDate<=$B$1:$B$315
EffectiveDate>=$C$1:$C$315
EffectiveDate<=$D$1:$D$315
$AI3=$P$1:$P$315
$F$1:$F$315="HM"
If they all return TRUE, then multiplying them together results in 1, but if any of them returns FALSE, then multiplying them results in 0, which won't match to 1 (the first argument of the MATCH function).
Related
I need to compare two columns I and L and copy matched result from M column. It is a list of 1000+ product codes (I,L) and EAN codes (M). So if cell I1 is found in range of L1:L1000 (lets say it found in L3 cell), then formula should copy the M3 cell.
Tried VLOOKUP and MATCH and some IF, but cannot figure it out how to make it work as it returns blank or REF! or N/A or errors-out completely. I'm desperate and don't know what i'm doing wrong...
=VLOOKUP(I1:I1164,L1:L1164,13,FALSE)
and with
=IF(ISNUMBER(SEARCH(I1,L1:L1000),M1," "")
Result should be in N column.
When using VLOOKUP, you need the lookup range to include both the range of values you're looking for (which MUST to be the first column) and the return values (whose column you specify as relative to the range. So in your case, you'll be looking up in L1:M1164 and using column 2 as return results (since column M is the second of L1:M1164).
Also, the value you're looking for will probably be just an item, relative to the current line. I'd thus try it that way (in N1):
=VLOOKUP(I1;$L$1:$M$1164;2;FALSE)
Wrapping it up in an IFERROR as suggested in SJR's answer might be a good idea too.
Try this
=iferror(index(m1:m1000,match(i1,l1:l1000,0)),"")
The match bit returns 3, the index bit then looks for the 3rd value in column M; the Iferror returns an empty string in the event of an error (i1 is not found).
I have a table with time on the left and number of houses on top. i want to print a value for a specific house in a specific time. i am using vlookup to match the house and the value but unable to match it with time. as seen in the screenshot the value should only b printed fron 12:15 to 12:45. formula i am using is =IFERROR(VLOOKUP(I$10,$B$3:$C$3,2,FALSE),""). Can anyone help to point me in the right direction.
workbook is attached for sample.
sample workbook
Try this in I11 then fill right and down.
=IF(AND($H11>=$B$6, $H11<=$C$6, I$10=$B$3), $C$3, TEXT(,))
Can you try using INDEX of your table, once you know which row and column you want?
You can then get the row and column number from within your range by using MATCH, for example:
column number: =MATCH(10,[housesRange],0)
and
row number: =MATCH([time],[timeRange],0)
This can be combined with index:
=INDEX([fullTable],[rowNumber],[columnNumber])
Assuming you're looking for a 2 dimensional search of the table, you should use vlookup and match:
Let's for the answer's sake define the table range as
A1:J10
the column number (house number) cell is:
I1
and the start time cell is:
I2
vlookup, does a search on a column and returns a result from the found row in a defined column
to find the column to return, we can use match, match would return the column number of a value, so in this case:
=MATCH(I1,A1:A10,0)
The last parameter, 0, refers to an exact match.
with a vlookup, we have the 2d search:
=VLOOKUP(I2,MATCH(I1,A1:A10,0), 1)
Since the time is set as range, I defined the last parameter of vlookup as 1, so it will found the closest time to the search parameter
Hope that helps
I have this function:
MATCH(1,(PositionParameter[[#All],[Position Revised]]=$C94)asterisk(PositionParameter[[#All],[Campus Type Short]]=G$3)asterisk(PositionParameter[[#All],[Campus Num Arbitrary]]=G$1),0))
and I can't figure out what it does. I don't know what the asterisks are for. PositionParameter is the name of the worksheet, Position Revised is the name of a column, Campus Type Short is the name of a column, and Campus Num Arbitrary is the name of a column. There is suppose to be an asterisk between the first PositionParameter() and the second PositionParameter(). There is supposed to be another asterisk between the second PositionParameter() and the third PositionParameter(), but it is rendered as an italic. I took the asterisk out and spelled it out. The tooltip tells me this is suppose to return some sort of array, but I can't figure out its components. Can someone explain the asterisks to me? I would appreciate it.
Thanks,
Howard Hong
Your formula returns a single value - the relative position of the first row in the data where all three conditions are met.
It works like this:
Each of these three conditional statements:
PositionParameter[[#All],[Position Revised]]=$C94
PositionParameter[[#All],[Campus Type Short]]=G$3
PositionParameter[[#All],[Campus Num Arbitrary]]=G$1
.....returns an array of TRUE/FALSE values. Multiplying these three arrays together produces a single array of 1/0 values, 1 when all conditions are met in a row, 0 otherwise. This array forms the "lookup array" of the MATCH function
The "lookup value" is 1 so that value is looked up in the lookup array and the result of the MATCH function is the position of the first 1, which corresponds to the first row where all conditions are satisfied.
If there are no rows which meet all three conditions then the result is #N/A
Note that the zero at the end is the third parameter of the MATCH function - zero menas that an exact match must be found.
This is an "array formula" which needs to be confirmed with CTRL+SHIFT+ENTER
Often you would use this in conjunction with INDEX function to return a value from another column in the first row where conditions are satisfied, e.g. using normal cell references
=INDEX(A:A,MATCH(1,(B:B="x")*(C:C="y"),0))
That formula will return the value from column A in the first row where the two specified conditions are met (col B = "x"and col C = "y")
Well, asterisk could be a multiplication symbol or it could be a wildcard in Match. By the looks of the placement, I'd say it's multiplying data from an array or table.
And, um... I don't know what the asterisks are for but I took the asterisk out and spelled it out? Why would you do that? Was it working before you changed it? Where did you find this formula?
Please read [mcve]. Without sample data or other information about the purpose of the formula, I will take a wild guess:
Paste this into the cell:
=MATCH(1,(PositionParameter[[#All],[Position Revised]]=$C94)*(PositionParameter[[#All],[Campus Type Short]]=G$3)*(PositionParameter[[#All],[Campus Num Arbitrary]]=G$1),0))
. . . and assuming it's supposed to be an array, instead of hitting Enter on that cell:
hit: Ctrl+Shift+Enter to create an array formula.
Besides the link above, here is some other reading & practice for you:
Create an array formula
MATCH function
I think certains applications replace certain symbols (that aren't allowed in the application] with words when copying and pasting from Excel to them, but without more information about what happened, I can't say for sure what happened.
Assuming that the * are real and that the formula is entered as an array formula then it should return an array of 0s and 1s.
The formula is looking for Position Revised=C94 AND Campus Type Short =G3 AND Campus Num Arbitrary = G1
It will return a 1 for each row that matches all these conditions and a 0 for each row that does not.
If no rows match the conditions it will return #N/A
I have the following set up in Excel, and I am attempting to lookup the first column in the range A5:A7, and return column 8 (the rate) plus the custom rate.
I am using the following thus far and it returns the #REF! error.
=G11+VLOOKUP(A11,$A$5:$A$7,8)
So for instance, to in row 11, I am trying to find the word Flash under the Type in the range A5:A7, and return the rate that it has (column #8 or H).
It should result in $0.26.
I am new to Excel, so any help is appreciated! :)
You should use this one instead:
=G11+VLOOKUP(A11,$A$5:$H$7,8,0)
Note, that I use $A$5:$H$7 intead $A$5:$A$7. Second change is to add 4th parameter equals to 0. When this parameter is FALSE or 0, VLOOKUP will only find an exact match. In this case, the values in the first column of $A$5:$H$7 do not need to be sorted. But when you ommit this parameter - VLOOKUP searches for exact/approximate match and values should be sorted.
I'm having an issue with a spreadsheet formula that uses the MATCH() function.
=IFERROR(IF(LENB(Y2461)<> 0, "Complete", IF(LENB(Q2461)<> 0, IF(Q2461-$Y$1<MATCH($Y$1,R2461:X2461),"ON HOLD"), INDEX($R$4:$X$5,1,MATCH($Y$1,R2461:X2461)))),"ON HOLD")
This is the formula in the cell with the specific problem. I'm using match to look through a horizontal range of data and determine which column contains the most recent change, with exceptions for when the "Complete" column has a date, and the "ON HOLD" column has a date. Cell Y1 contains =TODAY(), so it checks each cell against today's date. The cells are formatted into dates, and are entered as dates from left to right. However, the entries can start again from an earlier column and leave the dates out of order.
The issue is, on only a few occurrences at a time, MATCH() will return a column that isn't the most recent. As far as I've been led to believe, and how it works for the other instances of this formula, is that it reads the array from right to left and stops at the first "highest" date.
The error is occurring on one row specifically, while the expected result works multiple times elsewhere on the sheet.
Am I using MATCH() wrong by assuming that it will read in a certain direction every time? Is there a different error in the code? Or is there a different way to get the result I've programmed it for?
MATCH with no third argument as you are using it is the same as MATCH with 1 or TRUE as third argument, which means that you can only guarantee that it will work OK if the range used - R2461:X2461 - is always in ascending order....but you say that isn't the case so I don't think you can guarantee the formula will work
Try using this version instead [revised as per comments]
=IFERROR(IF(LENB(Y2461)<> 0, "Complete", IF(LENB(Q2461)<> 0, IF(Q2461-$Y$1< MATCH(MAX(IF(R2461:X2461<=$Y$1,R2461:X2461)),R2461:X2461,0),"ON HOLD"), INDEX($R$4:$X$5,1,MATCH(MAX(IF(R2461:X2461<=$Y$1,R2461:X2461)),R2461:X2461,0)))),"ON HOLD")
confirmed with CTRL+SHIFT+ENTER
The logic of the alterations is that this revised MATCH part
=MATCH(MAX(IF(R2461:X2461<=$Y$1,R2461:X2461)),R2461:X2461,0)
will do the same as this part
=MATCH($Y$1,R2461:X2461)
whether R2461:X2461 is in ascending order or not - it finds the largest values which is <= to Y1 and gives you the position of the first instance.
Revised
If you want the rightmost date where the largest date <= today is duplicated then you can use this construction in place of MATCH
=MAX(IF(R2461:X2461<=$Y$1,COLUMN(R2461:X2461)-COLUMN(R2461)+1))
which would make the complete formula like this:
=IFERROR(IF(LENB(Y2461)<> 0, "Complete", IF(LENB(Q2461)<> 0, IF(Q2461-$Y$1< MAX(IF(R2461:X2461<=$Y$1,COLUMN(R2461:X2461)-COLUMN(R2461)+1)),"ON HOLD"), INDEX($R$4:$X$5,1,MAX(IF(R2461:X2461<=$Y$1,COLUMN(R2461:X2461)-COLUMN(R2461)+1))))),"ON HOLD")
Omitting the [match_type] from the syntax MATCH(lookup_value, lookup_array, [match_type]) may lead to unexpected results when the lookup_array is not sorted.
http://office.microsoft.com/en-gb/excel-help/match-function-HP010062414.aspx