excel SVERWEIS displays #NV - excel

hope you can help me :-)
My table looks like this:
A B C D
23940823 Larissa Horst =VLOOKUP(C1;A1:B2000;1;FALSE)
23940824 Horst Leon =VLOOKUP(C2;A1:B2000;1;FALSE)
23940825 Fred Kim =VLOOKUP(C3;A1:B2000;1;FALSE)
23940826 Horst Peter =VLOOKUP(C4;A1:B2000;1;FALSE)
I would like to get the number from the specific A, if the Value of C is in B. So for "Horst" it should be "23940824"in this case, but it only displays "#NV".. Do you know why?

It's because SVERWEIS search the first column and goes to right. You need here INDEX instead:
=INDEX(A:A;C1) 'where C1 is your search string
See also MS-docu: https://support.office.com/de-de/article/INDEX-Funktion-a5dcf0dd-996d-40a4-a822-b56b061328bd
Update
First check if the value of cell C is in column B. If so it displays the value of cell A he is finding:
=IF(ISERROR(MATCH(C1;B:B;0));"Not in Column B";INDEX(A:A;MATCH(C1;C:C;0))) 'for D1
Remember that the key words could be different if you use no english excel version (like english = IF, german = WENN)

Related

Excel match data and add value

It is really hard to find right solution or answer for this. Thank you in advance!
So in Excel I have 100 places which are named "Place AB A100" Place AC B A101" etc. they all have that unique code "A1xx" at the end.
Then I already have the value for the codes. For example "A100" = A, "A101" = A, "A102" = B, "A103" = C.
Now I just need to match the codes and add the values (told above) next to the name column. It is hard for me because the places need to stay in exact sort and they are mixed...like:
Place XX A110
Place XX X A153
etc.
Looks like this:
Column A Column B Column C Column D
Place A A101 A100 B
Place AA X A123 A101 B
Place AB A119 A102 C
Cannot figure out how XLOOKUP or something else would work here...help pls.
-Drants
I've tried but haven't succeed yet.
XLOOKUP, VLOOKUP, just cant do it manually... there must be formula to figure this out! :D

Picking a Option from a cell by a value in ms excel

i'm looking for a formula where i can copy text from A to D option according to the option text in Ans column. see the attachment for more information.
if the Ans column has value B than value from option B should print in AnsText Column and so on.
Try any of following formulas.
=INDEX(B4:E4,MATCH(F4,B3:E3,0))
=XLOOKUP(F4,B3:E3,B4:E4)
=FILTER(B4:E4,B3:E3=F4)
=HLOOKUP(F4,B3:E4,2,FALSE)
If A, B, C and D are always going to be in alphabetical order, then the lookup function will work best.
=LOOKUP(E2,A1:D1,A2:D2)
If not, the the HLOOKUP will need to be used
=HLOOKUP(E2,A1:D2,2,FALSE)

Appending separators in the formula

Can someone help on this? I have column A with telephone number and Column B with country code. I want to remove the country code in column A if it is there to avoid duplication. Can someone help me?
Column A 1234567 Column B 1 Column C 1234567
Column C should have the formula to check if 1 is already in the beginning of the cell value A, if yes, it'll remove it, but if not, column B value will be added to it. Another scenario is below: Column A 234567 Column B 1 Column C 1234567
Also, I would like to add separators in this formula after the country code, and after three digits of the country code based on column 1 with removed country code in it.
How to append it in this formula?
=IF(B1 = --LEFT(A1, LEN(B1)),A1,--(B1&A1))
Appreciate your answer!
As far as I understand what you describe, you may be after something like this:
="+"&TEXT(B1,"0")&"-"&
IF(LEFT(TEXT(A1,"0"),LEN(TEXT(B1,"0")))=TEXT(B1,"0"),
MID(TEXT(A1,"0"),LEN(TEXT(B1,"0"))+1,99),
A1)
The statement about "after three digits of the country code based on column 1 " is unclear. This formula gives you tools to add characters before and after the country code, while it removes country code duplication.
edit after comments You don't really describe it, at least not clearly, but it looks like you want a vertical bar after the country code and again after the first three digits of the phone number. The formula to achieve that is
=TEXT(B1,"0")&"|"&
REPLACE(IF(LEFT(TEXT(A1,"0"),LEN(TEXT(B1,"0")))=TEXT(B1,"0"),
MID(TEXT(A1,"0"),LEN(TEXT(B1,"0"))+1,99),
A1),4,1,"|")
another edit after stitching together what else you might want but don't clearly describe: If column B can possibly contain either numbers like 1 or 63 but also text that starts with a country code, followed by a space and some other stuff, like 63 2, then you can use this formula
=LEFT(TEXT(B2,"0"),FIND(" ",TEXT(B2,"0")&" ")-1)&"|"&
REPLACE(IF(LEFT(TEXT(A2,"0"),LEN(TEXT(B2,"0")))=TEXT(B2,"0"),
MID(TEXT(A2,"0"),LEN(TEXT(B2,"0"))+1,99),
A2),4,1,"|")

If Then, concatenate when condition is met

I want to simplify an everyday work task. I am looking for a macro or a formula that will look at Column C, and if New is present, combine N with the data from Column A; if Used is present, combine U with the data from Column A.
Before:
A B c
123456 New
234657 Used
345678 New
After:
A B c
123456 N123456 New
234657 U234567 Used
345678 N345678 New
In the case where its not a matter of IF in column C but just whatever the first letter of column C is, drop the IF portion and go straight to the concatenation.
=LEFT(C1)&A1
Assuming there are only New and Used, this can go in B1 and drag down.
=IF(C1="New","N"&A1,"U"&A1)
If there are other options, then you can use this one:
=IF(C1="New","N"&A1,IF(C1="Used","U"&A1,""),"")
Alternate:
=IF(OR(C1={"New","Used"}),LEFT(C1)&A1,"")

Select all cells in column B where Column A in that row contains a specific text

Basically I have a price list where I want to average the price of all the items on the list that contain my keyword.
The keyword is keyword, price column is B and item description in which to look for keyword is in column A.
I'd like to have a formula like
=Average(data_table,all cell B from row i (i,B) where (i,A) contains keyword)
To Simplify, I added a picture. I tried the suggested solutions below but none worked. I should get 15.33 (Assuming the indices go from 1 to 5 and not from 2 to 5 as in the picture)
Use AVERAGEIF, which I believe became available in Excel 2007. This will handle "keyword" by itself, or as part of a longer string like "my keyword".
=AVERAGEIF(A2:A5,"*keyword*",B2:B5)
To refer to a cell containing a keyword, D1 in this example, use:
=AVERAGEIF(A2:A5,"*" & D1 & "*",B2:B5)
I would suggest the following:
=AVERAGEIFS(B:B,A:A,"*"&"keyword"&"*")
Cheers!
::Edit for Updated Question::
With your new layout, use the following:
=AVERAGEIFS(B1:B5,"*"&D1&"*",A1:A5)

Resources