Alternative to vlookup with exact and approximate match doesnt work - excel

Cell A1: 0553400710
Cell A2: John
Cell B1: ['0553400710', '0553439406']
Note:
List item 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?
Vlookup failed to work by the way. I am looking for some technique which uses the advantage of fixed format
Picture 1: This is the formula i have tried
Picture 2: This is the table where the vlookup is showing wrong values
Picture 3: This is the array where vlookup check

Going by the sample data (and references) in your narrative and ignoring the image(s), a simple wildcard match should be sufficient.
=IFERROR(INDEX(A:A, MATCH("*"&A1&"*",B:B, 0)+1), "")

Have you tried index/match?
=index(return_range,match(cell_to_match,range_to_match,0))

Related

Google Sheets or Excel: setting the value of a remote cell from a formula

Is there a way to create a formula in one cell that will change the value in another cell based on some criteria, without scripting? Example: cell a1 contains a numerical value. cell b1 contains a value from a drop-down list, say, "YES,NO". If cell b1 is set to "YES" I want to remove (set to zero) the value in cell a1. What I'd like to do is have a formula in cell c1 that interrogates b1 and sets the value in a1 accordingly. Is the only way achieve this writing code and using setValue?
you cant remove it without a script. you can visually hide it in various ways. if the A1 is subject of further sum (as in your case per your comment) the sum formula can be always altered to reflect desired output. example:
if your formula is
=SUM(A1, C5, D22)
you can do
=SUM(IF(B1="YES", 0, A1), C5, D22)
Use the following on the cell you need the calculation (or zero) on:
=IF (B1="YES",0,SUM(A:A))
Using the given formula, you would do the SUM calculation for the whole Column A if the value on B1 is "YES", if not, then a 0 would be placed on the cell you put the formula on.

In excel, how to return nearest cell that contains date

I have a column that contains text cells and date cells. Next to each cell of text, I need the nearest cell that is above that text and contains a date to be returned.
Example
You can use INDEX/MATCH:
=IFERROR(INDEX($A$1:A1,MATCH(1,$A$1:A1,-1))/(ISTEXT(A1)),"")
You have to use a column agent (English is my second language so please give me a better way to describe it if you know), let's say column C.
Put this formula to C1:
=A1
Put this formula to C2 and fill down:
=IF(ISERROR(DATE(DAY(A2),MONTH(A2),YEAR(A2))), C1, A2)
The above formula check if A2 is a date then copy it or fill it down by the cell above.
Copy the cells you want in column B (B2:B4,...) from column C. Hide column C if you want.
Try below formula.
=IF(ISTEXT(A1),AGGREGATE(15,6,$A$1:$A$10,COUNTIF($A$1:$A1,">1/1/1900")),"")
If there are numbers also in cells rather that names then you can use below formula
=IF(LEFT(CELL("format",A1),1)="D","",AGGREGATE(15,6,$A$1:$A$10,COUNTIF($A$1:$A1,">1/1/1900")))
You can also use the LOOKUP function:
B1: =IF(ISNUMBER(A1),"",LOOKUP(2,1/($A$1:A1),$A$1:A1))
and fill down.

Excel: Format cells if it finds similar strings in cells

Given the example:
A1: Smith, John Michael
A2: John Michael Smith
What is the formula if I want to format cells (let's say color the cells green) when it finds the string "Smith" in both A1 and A2?
A1 -> list from excel file
A2 -> list from database
I'm comparing a list of names extracted from a user database and the list of names on an Excel file to see if which ones are missing in the database.
Assume you place the word you are looking for in A4, you could use the following formula:
=AND(ISNUMBER(SEARCH(A4,A1)),ISNUMBER(SEARCH(A4,A2)),NOT(TRIM(CLEAN(A4))=""))
Search will look for the text entered in cell A4 and see if it can be found in A1. If it is found it will return a number and if is not found it will return an error.
Isnumber checks to see if the search returned a number. if search found the word entered in A4 in A1, it will return the number of the starting position and is number will then return a value of TRUE.
The process is then repeated for the text in A2.
In order to say that the text is found in both locations you need all arguments in the AND formula to be TRUE. if any one of them is false AND will return a value of FALSE.
The final step will be to apply conditional formatting to the cells. Use formula as your method for your conditional formula control and use the above formula in the space provided. Set your special format for when your formula returns a true value.
Depending on how you apply your conditional formatting, you may want to use $A$4 instead of A4. Same goes for A1 and A2.
The last logical check that was added was to make sure that if no information was entered in A4, or a space was entered in A4 that the check would colour the cells. In other words it will only colour the cells if there is actually something to look for in A4.

Struggling with specific Vlook up - Or do I even need Vlookup?

Righto,
I need a formula to put in A2. I need to compare B2:B10 to G2:G10, and if theres a match, return the value in F.
For example, if the formula was in A1, it'd find the matching number (4321) in G7, and then return the value in F7 back to A1
I've tried using Index with Match, but didn't work :( Any suggestions?
An index and match should solve this. Index the range you want to return, and then an exact match looking up your value in column B to the range in column G should get you the value you are looking for.
Example if typed into cell A2 in your picture:
=INDEX($F$2:$F$10, MATCH($B2, $G$2:$G$10,0) )
If there is only one match for each value in column G, I would use the following Index/Match formula in field A2:
=index(F:F, match(B2,G:G,0))
Note: I will only return the first value if the value appears multiple times in the column.
In H2 enter:
=IF(B2=G2,F2,"")
and copy down. In A2 enter:
=TEXTJOIN(",",TRUE,H2:H10)
This will gather all matches.

Excel formula to find reference used by other cell

Is there a way to find out the address of the cell being referenced in another cell in excel?
E.g. cell C1 contains formula =max(A:A) and returns a value of 10 which is actually referenced to cell A10. Can I use a formula in cell B that returns 'A10'?
And no, I don't want to use VBA at all.
Assuming that your entries are in Cells A1:A7, you can do it this way ...
In Cell B1, the formula =MAX(A1:A7) and
in Cell B2, the cell location of the maximum number in the range (shown in B1) is given by the formula
=CELL("address",INDEX(A1:A7,MATCH(MAX(A1:A7),A1:A7,0)))
OR
=ADDRESS(MATCH(MAX(A1:A7),$A$1:A7,0),1)
Mark as answer if it helps.
Managed to find the solution:
Similar to Kyle's formula, but instead we use match with multiple criteria to be more specific e.g.
=ADDRESS(MATCH(MAX(A1:A7)&"A",$A$1:A7&$B$1:$B$7,0),1)

Resources