Alternative to vlookup with index and match in excel - excel

Cell A1: 0553400710
Cell A2: John
Cell B1: ['0553400710', '0553439406']
Note:
Cell B1 has a fixed format of ['number','number,'number',...... ]
A1 and A2 are user input values
I want to match 0553400710 in Cell A1 with ['0553400710', '0553439406'] in Cell B1.
If it matches, I want to return A2: John.
Is it possible?
I have asked the question before here. it has all the pictures attached as well. Unfortunately no one except one could solve it.
The one who gave me a nearest answer was Jeeped whose answer is
=IFERROR(INDEX(A:A, MATCH("*"&A1&"*",B:B, 0)+1), "")
The problem with this is that it takes the column array instead of rows array. I need it to be in rows as its the best practice for a database. Is there anyone who can improve this solution?
I have also tried vlookup as below but it failed
Here is the data for reference
and here is the input i am trying to match

Is it possible?
=IF(ISNUMBER(SEARCH(A1,B1)),A2,"number not found")
This will work for your example at the top. If A1 looks like ['0553400710'] you could try using SUBSTITUTE formula to remove punctuation.
Not sure what you were trying to do in the bottom bit, sorry.

Related

Problem with IF AND and Vlookup nested formula

I am trying to put a nested IF, AND and Vlookup formula. I want formula to return the value "0.17" in cell F3 if cell D3 has text "pasha" and B3 is not equal to cells mentioned in vlookup formula but its returns zero instead of showing 0.1. Please guide, TIA
=IFERROR(IF(AND(D3="Pasha",VLOOKUP(B3,G70:H78,2,0)<>B3),0.17,IF(VLOOKUP(B3,$B$69:$B$89,1,0)=B3,0.15,"")),0)
enter image description here
You may want to replace
VLOOKUP(B3,G70:H78,2,0)<>B3)
(Excel will unsuccessfully try to match B3 value with values from G column range while it contains different type of data:“Pasha”)
with
NOT(ISNUMBER(MATCH(B3,H70:H78,0)))
And feel free to adjust the second VLOOKUP accordingly.
So, how about this:
You need to to sort the vlookup() but the process for testing the conditions is there.

Excel lookup previous/above value when value matches

please help me. basically the 2 formulas works separately, but doesn't work when I combine them:
In cell A2 I have this formula:
=ROW(INDEX(Sheet2!$A$2:$A$7512,MATCH(Sheet3!H2,Sheet2!$A$2:$A$7512,0)))
This formula gets matches a value from another sheet and get its row number.
In cell B2 I have this formula:
=LOOKUP(2,1/(LEFT(INDIRECT("Sheet2!A2:A"&A2),2)="FA"),INDIRECT("Sheet2!A2:A"&ROW(INDEX(Sheet2!$A$2:$A$7512,MATCH(Sheet3!H2,Sheet2!$A$2:$A$7512,0)))))
This formula starts with the range from A2 and finds the last previous value starting with "FA".
This works fine.
But When I copy/paste A2 into B2, I get #N/A (bold part is what I pasted).
=LOOKUP(2,1/(LEFT(INDIRECT("Sheet2!A2:A"&ROW(INDEX(Sheet2!$A$2:$A$7512,MATCH(Sheet3!H2,Sheet2!$A$2:$A$7512,0)))),2)="FA"),INDIRECT("Sheet2!A2:A"&ROW(INDEX(Sheet2!$A$2:$A$7512,MATCH(Sheet3!H2,Sheet2!$A$2:$A$7512,0)))))
Anybody might know whis this happens? Basically I just want to be able to fit everything in 1 formula instead of using 2 columns to get 1 value.
THANK YOU!!!
enter image description here

Extracting other column value based on lookup

I have one large row of data, containing multiple observations. The data consits of:
PO number
Amount
Location
See attached image:
Now what I want is that PO Number 8382 (A2) is looked up in A8:L8 and puts in B2 the amount of each PO number and puts in C2 the location. So what it needs to do, is lookup a value in the row and extract the value on the right of it. I tried H.lookup but that did not work.
Can anyone help me? I used index and match, but I can't make it work. I believe it's probably a simple question but I can't figure it out.
Thank you in advance!
Your thinking is correct.
In cell B2:
=INDEX($A$8:$L$8,1,MATCH($A2,$A$8:$L$8,0)+1)
In cell C2:
=INDEX($A$8:$L$8,1,MATCH($A2,$A$8:$L$8,0)+2)
Copy down.
Try this (It find first occurence in ROW 8)
Cell B2 formula =OFFSET($A$1;1;MATCH($A2;8:8;0);1;1)
Cell C2 formula =OFFSET($A$1;1;MATCH($A2;8:8;0)+1;1;1)
You could use:
=IFERROR(INDIRECT(ADDRESS(8,MATCH(A6,$A$8:$H$8,0)+1)),"PO not found")
using IFERROR you avoid receiving errors if any of the PO not found.

Excel Choosing Column based on filter criteria of other column

Name Skill
Mike Engineer
Salom Doctor
Riku Labour
Sindu Engineer
We need to select who all are engineers or doctors
Use COUNT and SEARCH. If D2 is the cell you're searching in then:
=COUNT(SEARCH({"Doctor","Engineer"},D2))
Drag this formula downwards to apply to all rows.
Edit: As you now mentioned that you want to print the names in the Result column, combine the above formula with IF like this:
=IF(COUNT(SEARCH({"Doctor","Engineer"},D2)),C2,"")
where D2 is the cell that you're searching in and C2 is the cell that you want in the result cell if Doctor or Engineer exists in the cell D2. Dragging the formula downwards to apply to all rows gives:
You should accept #SardarUsama's solution as answer because it answers your actual question. If your requirement changes/extends or you were not able to put your question correctly to others then it is advisable that you accept the provided solution and then ask new question instead of making people change answer number of times.
Now, coming to your question (as per comment shared between you and #SardarUsama's) following might be helpful.
Enter the following formula in Cell C2
=IFERROR(INDEX($A$2:$A$10, SMALL(IF(($B$2:$B$10="Engineer")+($B$2:$B$10="Doctor"), ROW($A$2:$A$10)-1, ""), COLUMN(B$1)-COLUMN($A$1))),"")
This is an array formula so commit it by pressing Ctrl+Shift+Enter
Or else you can use another array formula
=IFERROR(INDEX($A$2:$A$10, SMALL(IF($B$2:$B$10={"Engineer","Doctor"}, ROW($A$2:$A$10)-1, ""), COLUMN(C$1)-COLUMN($B$1))),"")
Drag/Copy across as required. See image for reference.

Use cell value as part of a reference to a cell range in a formula

My problem is similar to that in this quesion: Row in formula change based on value in another cell, i.e. I want to use the value of a cell as reference to another cell in a formula of yet another cell.
However, I want the value of a cell to only be the part of a cell range. Let me give you an example:
A1 holds worksheet-a
In C1 I'd like to have a forumla that results in =SUM('worksheet-a'!B:B)
Based on the other question, I thought that something like =SUM(INDIRECT(A1)&"!B:B") might do it. Sadly, it does not.
Do you have any ideas?
Thank you!
For me it works in this way
=SUM(INDIRECT(CONCATENATE(A1;"!B:B")))
or with ampersand
=SUM(INDIRECT(A1&"!B:B"))

Resources