Excel VLookup #NV error - excel

I'm trying to make a VLookup in Excel but I get everytime a #NV error.
This is table EVENTS:
This is table TRACK:
the formula on field F2 in table EVENTS is
=SVERWEIS(E2;TRACKS!$A$2:$B$52;1;FALSCH)
SVERWEIS is the word for VLOOKUP in the German version. FALSCH means wrong

As has been mentioned, VLOOKUP (SVERWEIS) can only look to its right to find a value to correspond with a value in the left hand columns of a table. The INDEX/MATCH combination is more flexible in this respect so if not to rearrange your columns I would suggest something like:
=INDEX(A:A,MATCH(E2,B:B,0))
where TRACK is assumed to be in ColumnsA:B. Converting to German, perhaps:
=INDEX(TRACKS!A:A;VERGLEICH(E2;TRACKS!B:B;0))

VLOOKUP compares the values in the first column of your reference target, you have your target values in the second.
Just swap VLOOKUP and the TEXT columns on your TRACKS sheet and it will work just fine.

Try switching the columns in TRACKS around.
VLOOKUP bases it's lookup on the first column, so in your case, it's looking through column A (1, 2, 3, etc.)
If you want your VLOOKUP to be based on the text, it needs to be in A instead.
i.e.
| A | B |
----------------------
1 | TEXT | VLOOKUP |
2 | Text1 | 1 |
3 | Text2 | 2 |
etc...
Then your function will be:
=SVERWEIS(E2;TRACKS!$A$2:$B$52;2;FALSCH)
Switching out the third argument because you now want the value from the second column

Related

Extracting all information(different) with same row name form a excel worksheet using formula

I have a excel workheet having a table with multiple rows having same name with different information in the corresponding columns. Now using a formula I want to extract this infomation into a new table? SOLUTION HAS TO BE USING AN EXCEL FOMULA ? NO FILTERS NO PIVOT TABLE OR VBA
I have tried vlookup. to search for multiple values. I dont want information from a single column but rather from all the columns. There could be thousands of columns with same and different values.
I have tried this formula : =INDEX(Worksheet!A2:AK350;KKLEINSTE(WENN((A5=Worksheet!A2:A350);VERGLEICH(ZEILE(Worksheet!A2:A350);ZEILE(Worksheet!A2:A350));"");1))
The table looks like this for example:
Place People Salary Status
japan | resident_1 | 564 | un-married
Delhi | resident_1 | 655 | un-married
china | resident_1 | 564 | un-married
japan | resident_2 | 748 | un-married
Now I want to extract a sub table from the above, like all the
infomation having PLACE name as "japan"
the reult should be this for each place in a different table:
japan | resident_1 | 564 | un-married
japan | resident_2 | 748 | un-married
Seems like a job for advanced filter, but you've already stipulated "no filters". If you're able to add two helper columns in your main table, maybe you can use the approach below.
This is my main_table worksheet (note the columns outlined in red, which have been added).
The formula in column E (starting from cell E2) is: =CONCAT(A2,"|",B2,"|",C2,"|",D2)
The formula in column F (starting from cell F2) is: =ROW()-ROW($F$2)+1
Drag/fill these formulas down to the last row in your main table.
This is my sub_table worksheet (note the cells outlined in green at the top, where you will eventually specify filter criteria).
The formula in column A (starting from cell A5) is: =ROW()-ROW($A$5)+1
The formula in column B (starting from cell B5) is: =IFERROR(SMALL(IF(ISNUMBER(SEARCH($B$2,main_table!$E$2:$E$10)),main_table!$F$2:$F$10,""),$A5),"")
The formula in columns C, D, E, F (starting from cell C5) is: =IF(ISNUMBER($B5),INDEX(main_table!$A$2:$D$10,$B5,COLUMNS($C5:C5)),"")
The formula in cell B2 is: =CONCAT(IF(ISBLANK($C$2),"*",$C$2),"|",IF(ISBLANK($D$2),"*",$D$2),"|",IF(ISBLANK($E$2),"*",$E$2),"|",IF(ISBLANK($F$2),"*",$F$2))
You should drag the formula down for the same number of rows that are in your main table.
I think newer/upcoming versions of Excel have a JOIN worksheet function which is more convenient/flexible than my usage of CONCAT above (so maybe use that if it's available to you).
Leaving the filter criteria blank should give you all rows. If you want partial matches, include wildcards in your input e.g. jap* or resident_*. If any of the values in your main table contain a |, you may want to use a different delimiter in the CONCAT formulas (otherwise you may get unexpected results/behaviour).
Once you're done, maybe you can use it like shown below:
See if this approach is any good for you (you will probably need to translate the formulas to your locale/region).

Excel Formula - Return unique count of range based on multiple criteria from different tables

I have three tables: Parties, Document Detail and Document. (Note, they are not table formatted, so all references are based on cell and sheet location, not table aliases)
I want to return a unique count of the parties in each Document using an Excel Formula. My problem is, I would usually use a =COUNTIFS() formula for this, which would be something like the following, which I would put in B2 of Sheet 3 (Document table):
=COUNTIFS(Sheet2!A:A,A2,Sheet2!B:B,Sheet1!A2)
But this will only return the count of one criteria at a time, not a count checking for all values of the parties table per document. I understand it should be able to be done with an array formula, but I can't figure it out. Bonus points if someone can figure out how to do it with a non-array formula!
Sheet1 - Parties Table
A
1|Parties |
+-----------------+
2|Education Officer|
3|Elder |
4|Family Support |
5|Interpreter |
Sheet2 - Document Detail Table
A B
1 |Doc ID | Party |
+-------+-----------------+
2 |FID0001|Education Officer|
3 |FID0001|Elder |
4 |FID0001|Education Officer|
5 |FID0001| |
6 |FID0001| |
7 |FID0002|Elder |
8 |FID0002|Interpreter |
9 |FID0002|Family Support |
10|FID0002| |
Sheet3 - (Desired Result) - Document Table
A B
1|Doc ID |Party Count|
+-------+-----------+
2|FID0001| 2 |
3|FID0002| 3 |
TL:DR
What combination of Excel formulas can I use to return the number of unique parties referenced in each document?
Based on this answer by Barry Houdini and expanded to include the DocID criteria
Put a helper column on Sheet2, lets say in colum C
=IFERROR(1/COUNTIFS($B:$B,$B:$B,$A:$A,$A:$A),0)
and copy down for all data rows
Then, in Sheet3 Party Count Formula is
=SUMIFS(Sheet2!$C:$C,Sheet2!$A:$A,$A:$A)
The non-Implicit Intersection versions
Sheet2 cell C1
=IFERROR(1/COUNTIFS($B:$B,$B1,$A:$A,$A1),0)
Sheet3 cell B2
=SUMIFS(Sheet2!$C:$C,Sheet2!$A:$A,$A2)

Increment count in column based on value in column

I've 2 columns A and B. A contains names and B contains the count of those names till that record as shown below.
-----------------------------------
| A | B |
-----------------------------------
1 | Fruits | 1 |
2 | Flowers | 1 |
3 | Fruits | 2 |
So, want to have a formula for this. Expecting an array formula. Even if an array formula is not possible, a general formula
Attached a spreadsheet so that it can be explained better.
https://docs.google.com/spreadsheets/d/1wlWqdFwgv90s50iP-bXXBHciyualohj610qFiSatcmQ/edit#gid=1997586177
You do not need an array formula, and I would avoid them when possible. You can accomplish your task with
=COUNTIF(A$1:A1,A1)
Where A1 if the first value in the column of values you want to count. The $ allows you to anchor the top of your COUNTIF range while leaving the bottom dynamic.
In a google spreadsheet you may want to try:
=ArrayFormula(iferror(SORT(ROW(A1:A),SORT(ROW(A1:A),A1:A,1),1)-MATCH(A1:A,SORT(A1:A),0)-ROW()+2))
Example sheet

Excel multi column lookup

I am unsure how to Google this one. I have a table that looks like the below
Last Name | First Name | Team A | Team B | Team C
Smith | John | X | |
Doe | Jane | | X |
This would be the main sheet. The names in this sheet are divided into other sheet depending on what department they are in. Those sheets are setup in the same formats with the same columns. If the people in the main sheet are marked with an X in one of the columns I would like that same column marked in marked in the department sheets.
Your best bet might be to create a hidden column A where the value is a combination of column B and column C on all of your tabs. You could then use the standard VLOOKUP wrapped in an IFERROR clause.
For example,
=IFERROR(VLOOKUP(A1,Sheet1!A:F,3,False),"")
The IFERROR handles the instance that you may have a name on a sub tab not on the main tab. It returns blank instead of #N/A. The VLOOKUP is checking the value in A1 to what is in A1 on your main tab. A1 would be the combination of First and Last. The VLOOKUP would need to be in each of your team columns shifting the column returned number in each VLOOKUP.

Excel Function Help - Compare 2 Cells in Worksheet to 2 Cells in another worksheet, if they match, return value from a different column

I'm wondering if someone would be able to offer some advice on the best way to do this please:
Data in Worksheet # 1
Col A | Col B | Col C
Part-1 | 8 | 2
Part-2 | 7 | 7
Part-7 | 9 | 4
Part-8 | 2 | 6
Data in Worksheet # 2
Col A | Col B | Col C
Part-1 | 8 | *Return value* (If Part-1 is found and 8 matches, return 2)
Part-2 | 7 | *Return value*
Part-3 | 8 | *Return value*
In Worksheet#2 in Cell C2 - I would like to check if the Part-1 in A1 is found in Col A in Worksheet#1. If it is, then I would also like to make sure the Number is B2 in Worksheet#2 matches the Qty in Col B next to the same part#, if both the Part# and Qty match, then i would like to copy across the value from the corresponding cell in Col C in Worksheet#1, to Col C in Worksheet#2. If it does not match, I would like it to return a 0.
Here is the a variation on Reinier's second approach in a form that will work in any version of Excel. You can use references to the specific data ranges, as I have done here, or to entire columns.
=SUM((A2=Sheet1!$A$2:$A$5)*(Sheet2!B2=Sheet1!$B$2:$B$5)*Sheet1!$C$2:$C$5)
This is an array formula, so it needs to be entered with the Control-Shift-Enter combination. It performs the same operation as the SUMPRODUCT. (There are several other ways to do this, such as using MATCH with INDEX or OFFSET.)
Essentially, what you are doing is a lookup based on values in two columns. Looking at it from that angle, you can use a the SUMPRODUCT function, which is supported in any version of Excel. Enter the following in Sheet2, cell C2:
=SUMPRODUCT((Sheet1!$A:$A=$A2)*(Sheet1!$B:$B=$B2)*Sheet1!$C:$C)
Select and drag down the right-bottom corner of C2 to complete column C.
This only works by virtue of the fact that the values in Sheet1, column C, are numbers. It breaks if value pairs in column A and B of Sheet1 occur multiple times, but you did not address that situation in your question in the first place.
For versions 2007 and up, you can use the more convenient function SUMIFS with basically the same approach:
=SUMIFS(Sheet1!$C:$C,Sheet1!$A:$A,$A1,Sheet1!$B:$B,$B1)
Alternatively, you can use a combination of IF and VLOOKUP functions. A formula that will work for Excel 2007 or newer is the following:
=IFERROR(IF(VLOOKUP($A1,Sheet1!$A:$C,2,FALSE)=$B1,VLOOKUP($A1,Sheet1!$A:$C,3,FALSE),0),0)
Older versions of Excel do not support IFERROR, but you can still use a similar approach as explained here.
I have uploaded an example workbook here, which includes an alternative method in column D of Sheet2 as well.

Resources