MATCH function not working on Table headers for some reason - excel

I am getting n N/A error when I am searching for a specific day in the header row. If you look to the right you can see the formula where I have searched for the position of 5 using MATCH and it works.
I have tried the following variations as well
MATCH(F7,Table2[[#Headers],[1]:[60]],-1)
MATCH(F7,Table2[[#Headers],[1]:[60]],1)
But these do not work.
On the right you can see that I have created a simple range of numbers from 1 to 9 and I have searched for the number 5 in it, it is working.
PS: I know I can just use the number "23" without using MATCH. But that is not the point, the column orders may be jumbled in some cases (product ID for example). The MATCH function shouldn't fail there.

Being used as table-headers the days are not treated as numbers. Thus, you need to convert the expression you would like to match into text using TEXT() like this
=MATCH(TEXT(F7;"0"); Table2[#Headers]; 0)
Hope this helps.

I would try =index(area or table, 1 this is the row, match( field to match, area to search, 0 = exact match))
Example source here https://exceljet.net/lessons/how-to-use-index-and-match-with-a-table
Hope this helps.

Related

VLOOKUP is not matching properly

I have a multisheet excel file where I am in sheet3 and trying to find the data for a person in sheet2 but it doesn't match correctly, it gets the data of another person.
So I am trying to get the number of days for "Tim" from sheet2:
but is shows like that:
The code is I used was =VLOOKUP($B81,sheet2!$A$2:$M$281,2)
try
=VLOOKUP($B81,sheet2!$A$2:$M$281,2,FALSE)
or
=VLOOKUP($B81,sheet2!$A$2:$M$281,2,0)
if you want exact match.
The last argument of the VLOOKUP function determines the nature of your look up.
1 - TRUE will return an approximate match which is useful when you want to look up a value from group of ranges in ascending order;
0 - FALSE will return an exact match which will return the first match based on your look up criteria.
If you do not input the last argument in your formula, Excel will presume you want to use 1 - TRUE and do an approximate match which will look up the closest (and smaller) match of Tim such as Sam which is considered ahead of Tim and return the value corresponding to Sam instead. However, if your formula is =VLOOKUP($B81,sheet2!$A$2:$M$281,2,) with a comma , at the end of 2, Excel will presume you want to use 0 - FALSE and do an exact match.
Terry W already answered about the exact match, however here you go for some more trail which helps you to work with v-look up easier way.
Table Of RAW Data
Table Of Sheet 2, where we need values of TIM
Trail 1 (Used For Jan):
=VLOOKUP(B4,Raw!A1:M4,2)
Which is worked without using exact match function, as you tired.
Trail 2 (Used For Jan):
VLOOKUP(A4,Raw!A1:M4,2,0)
Which is worked using exact match function as "0", as you tired.
Trail 3 (Used For Jan):
=VLOOKUP($B10,Raw!$A$1:$M$4,MATCH(C$9,Raw!$A$1:$M$1,0),0)
Here instead of using the Index_Num Used match function and used Exact Match Argument too. The match function helps to get exact value of the month, and which make work easier instead of mentioning the Index_Num as 1 and 2 and 3 and Ext... for next and next months. Below snap is for your view.
Please let me know if need any more clarification need on this.

Index with double Match returns incorrect closest values

I have an planning exported to Excel which looks like the following (tab ' Data'):
Each production line has a number of people working on it. Now is my goal to show how many people are working on a line per minute. We plan per product group, and several product groups combined form waht a line has to do per minute.
To get the production per minute I created the following (tab 'Conversie'):
=INDEX(Data!$H$2:$H$157;MATCH($N$1&A4;Data!$B$2:$B$157&Data!$C$2:$C$157;1))
In the example it works correct. However, the formula doesn't seem to always return the correct "Artikelomschrijving"(H) every time. I get incorrect return values when I extend this formula to other product groups.
I read that the data needs to be sorted ascending cause I use match_type 1. When I do that I get the right returns for some product groups, but the given example suddenly returns incorrect values.
I can't sort both column C and A in ascending order for the formulas to always return correct items. Can you help me to get past this hurdle?
After a little bit of google translate work, if I'm understanding your question correctly, you need to find the "Item Description" (H) of the record where the "Line" (B) = the value in N1 and the time is between the start and end times.
This is an array formula, you have to confirm it with Ctrl+Shift+Enter
=INDEX(Data!$H$2:$H$157,MATCH(1,(Data!$B$2:$B$157=$N$1)*(Data!$C$2:$C$157<$A2)*(Data!$D$2:$D$157>=$A2),0))
OR with semicolon syntax:
=INDEX(Data!$H$2:$H$157;MATCH(1;(Data!$B$2:$B$157=$N$1)*(Data!$C$2:$C$157<$A2)*(Data!$D$2:$D$157>=$A2);0))
I found the solution, thank you for pointing me in the right direction Valon Miller. This is the formula I fixed it with:
=ALS.FOUT(INDEX(Data!$H$2:$H$154;MATCH(1;(Conversie!L$1=Data!$B$2:$B$154)*((Conversie!$A32>=Data!$C$2:$C$154)*(Conversie!$A32<=Data!$D$2:$D$154));0));"")

Excel count instances of a value error

I need to count the amount of times a value shows up in the B column and display it in 3 seperate fields. What I came up with was this piece of code:
=COUNTIF(B2:B6716,"0")
=COUNTIF(B2:B6716,"1")
=COUNTIF(B2:B6716,"2")
But no matter how I enter this It keeps telling me the formula is incorrect. I tried removing the " around the three numbers aswell btw and even in order to test it I even used some words but it just won't work. Any idea how I can get this to work?
The error:
Try something like:
=COUNTIF(B1:B416; "=0")
As a criteria, you should rather put some string that appended to tested value forms a condition, not a particular number. This way, you can formulate more fancy criteria, like:
=COUNTIF(B1:B416; ">100")

finding dynamically a match between two tables; one has text and the other the search pattern

EXCEL - finding a match between two tables
https://drive.google.com/folderview?id=0B2WLaA0HlUBVWnlwaFRGMmdwaVU&usp=sharing - excel file
FILE : vraag.xlsm
I would like to make a dynamically solution, for searching a text pattern from one table if it is also in the text of an other table (in different columns).
(Dynamically, I mean if the are elements are added, deleted, changed)
So searching if one the elements from column 'ID_type' can be found in the text of column 'element'
!
table A [T_example] : in a column contains tekst (within maybe one
of the elements of the other table)
table B [T_rec_by_type] : contains several possible strings
edited : next seems to be a wrong approach : MATCH()
=IF(ISNA(VLOOKUP(A23;T_rec_by_type[ID_type];1;FALSE));FALSE; "File found in row " & MATCH(A23;T_rec_by_type[ID_type];0))
In the first example (exactly match, so not as search pattern), it works.
But the idea is to search in the text to find the searchpattern ... and return via VLOOKUP a value from an other column (in this stadium just ID_type).
A possible solution found in an answer online
EXCEL - Find category by searching keyword from other worksheet
https://drive.google.com/folderview?id=0B2WLaA0HlUBVWnlwaFRGMmdwaVU&usp=sharing - excel file
FILE : SearchAMatchtingStad.xlsm
In the hope to find a solution ... for my case via this answer, I tried it out but unfortunately without succes.
So what am I doing wrong?
(I tried it first with tables, columns and ...
=IFERROR(IF(INDIRECT("Sheet1!A"&MAX(IF(ISERROR(SEARCH(CONCATENATE("*";Table1[[stad 1]:[stad 3]];"*");[#shop]))+(Table1[[stad 1]:[stad 3]]="");0;ROW(Table1[[stad 1]:[stad 3]]))))=Table2[[#Headers];[antwerpen]];[#sales];"");"Not found")
to figure out my fault/problem, why it doesn't work ...
I did it just by one cell, but without luck)
= IFERROR( IF( INDIRECT("Sheet1!A" & MAX( IF( ISERROR( SEARCH("*"&Sheet1!$B$2:$D$4&"*";$B8)) + (Sheet1!$B$2:$D$4="") ; 0 ; ROW(Sheet1!$B$2:$D$4)))) = D$7;$C8; "") ; "Not found")
A small remark ENTERING AN ARRAY FORMULA: press the CTRL SHIFT and ENTER
In a way it seems that there is an issue with array formulas
So when I do a one to one 'search' it seems to work =SEARCH("*"&B2&"*";$B8)
But when I do it with an array (despite it is still an array but with "\" instead of { "genk" ; "mol" ; "leuven" ; ... }), it seems to be a problem, or not working the way I wished. =SEARCH(CONCATENATE("*";OR(Table1[[stad 1]:[stad 3]]);"*");B8)
So I give it a last try.
But with OR or without gives the same result.
And to check if it maybe a problem is with CONCATENATE, I created a simular table with the wildcard already implemented.
Maybe ONE important thing, I forget to say there is always a space in front of the ID_TYPE.
And the ID_TYPE itself followed by a number (of maximum 3 characters) and a space.
You may have to change ; to , and , to . according to your local.
#Tom Sharpe
Thanks for your answer, but when I tried it out, it doesn't work.
Maybe ONE important thing, I forget to say there is always a space in front of the ID_TYPE.
And the ID_TYPE itself followed by a number (of maximum 3 characters) and a space.
I used 0 - in case default, not found.
Correct Tom, if I use '=FORMULATEXT(B35)', I see the formula is surrouded by { and }.
So I don't understand what I'm doing wrong.
And it worked fine at your place, you did it with my spreadsheet? Strange.
I uploaded the file changed as "vraag2.xlsm"
#user3616725
Maybe ONE important thing, I forget to say there is always a space in front of the ID_TYPE.
And the ID_TYPE itself followed by a number (of maximum 3 characters) and a space.
put new file in the shared folder : vraag2.xlsm
Here's another solution without using Regex. It tests each element in the first column of the table in A1:A7 (ID_type) using FIND to see if it is a substring of the element in A25 and below. The row numbers of any matching cells in a1:a7 are stored in an array. Because you want the first match, it uses MIN to find the lowest row number. If there is no match, it stores a reference to a cell which is outside the table, i.e. A8. I'm using FIND because I don't want to match lowercase, otherwise ... "3 spots plafond" would match with A because it has an 'a' in it.
If you enter the array formula in (say) d25 and pull it down, it will give the row number of the first matching cell in the table. If you enter the second formula in (say) e25 and pull it down, it will give the corresponding cell in another column of the table, in this case column B (type).
The first formula in structured form is:-
=MIN(IF(ISERROR(FIND(T_rec_by_type[[#Data],[ID_type]],A25)),ROW(A$8),ROW(T_rec_by_type[[#Data],[ID_type]])))
and the second one in structured form is
=IFERROR(INDEX(T_rec_by_type[[#All],[type]],D25),"Not found")
The formulae in ordinary notation (which I find a bit easier) are
=MIN(IF(ISERROR(FIND(A$2:A$7,A25)),ROW(A$8),ROW(A$2:A$7)))
and
=IFERROR(INDEX(B$1:B$7,D25),"Not found")
ROW(A$8) above is just a not very subtle way of getting a row number which is greater than that of any rows in the table. You could just use an arbitrary large number, or perhaps add a Totals row to the first table and use that to get the reference.
I haven't been able to work out why your vlookup didn't work with the table (it's OK if I copy the cells somewhere else), perhaps other people can comment.
using REGEX functions from MORFUNC ADDON*
I used your vraag.xlsm shhet that you linked to.
In cell C25 put: =REGEX.MID(TABLE12[[#ThisRow],[element]],MCONCAT(T_rec_by_type[ID_type],"|"),,TRUE)
this will give you the first (left-most) of the "keywords" that appears in the corresponding "element" cell.
This is almost there. but you say that the "SSR" sensor is more important than V, so that's the one that should be displayed if they both appear.
this is not pretty, but will work (if u provide more details on possible "ID_type"s and the order of things in "element" field i might be able to come up with something more elegant...) :
paste in cell D25:
=IF(REGEX.COMP(Table12[[#This Row],[element]],A$2,TRUE),A$2,IF(REGEX.COMP(Table12[[#This Row],[element]],A$3,TRUE),A$3,IF(REGEX.COMP(Table12[[#This Row],[element]],A$4,TRUE),A$4,IF(REGEX.COMP(Table12[[#This Row],[element]],A$5,TRUE),A$5,IF(REGEX.COMP(Table12[[#This Row],[element]],A$6,TRUE),A$6,IF(REGEX.COMP(Table12[[#This Row],[element]],A$7,TRUE),A$7,""))))))
copy C25 and D25 down, for the other elements
MOREFUNC ADDON
Morefunc Addon is a free library of 66 new worksheet functions.
HERE is some information (by original author)
here is the last working download link I found
here is a good installation walk-through video

Excel can't find a value even though it exists within the worksheet

this is my first post so i am sorry if this is confusing at all. I am trying to use a vLookup to run a comparative analysis between two reports. I am using a part number as a reference and trying to return the cost associated with the part from one of the two reports. So, the first issue that I encountered was due to the fact that some of the part numbers had letters in them and some didn't, so to be consistent I used the following code to clean up the part numbers:
IFERROR(VALUE(F11&C11), F11&C11)
where F11 and C11 are two components of the part number that needed to be concatenated to generate the full number. Now, the vLookup will not return anything except for #N/A for a few of the part numbers that are actually in the sheet. All of the part numbers are formatted the same for the 892 part numbers that I am searching for but get a returned value on 571 of the 892 part numbers but of the remaining 321 part numbers that did not have a return, about a third actually exist in my sheet. Lastly and for example, part number 110874402 exists in both sheets but gets a #N/A from the vLookup. When I copy the value from one sheet and search it in the other sheet using Ctrl + F, I get the following:
(I have an image to show but apparently can't post it without a reputation of 10 or more...oops)
The highlighted cell shows that the value exists but Excel can't find it. Does anyone have any ideas why this is or what I could be doing differently? I've been having this issue for a few months now on separate projects and haven't found any resolution.
Thanks in advance,
try =VLOOKUP("*"&TRIM(F569)&"*", BOBJ!$D$3:$P$2237, 7, FALSE) - I have a feeling spaces may have crept around the part numbers, which means that the exact match will not work.
The TRIM takes the spaces from the cell you are looking at, and the "*"'s will allow a wildcard search - note that this also means that CAT would also match CAT1, but if it produces results where there were none before, it gives you something to check for.

Resources