Comparing 2 columns in excel to highlight match and difference - excel

I try to match data from my bank statement and data from my erp. The excel looks something like this:
I want to select the transaction number given in ERP data column and search it in Bank data column. If there is a match then concat the matched data and print in column D, else print the unmatched data in column E.
I am trying to use
=IF(ISERROR(MATCH(B2,$A$3:$A$30,0)),"",B2) but it's not giving appropriate results.

You can use this to return a value. I changed IF(ISERROR... to IFERROR function which returns the value of first argument if there is no error or the second argument if error occurs. I also used INDEX to get the value from column A and concatenate it with value from B.
=IFERROR(INDEX($A$3:$A$30,MATCH(B2,$A$3:$A$30,0)) & " " & B2,"")
This is formula for column D. In E you just need
=IF(D2="",B2,"")

Related

Find same value in different column and print data of adjacent column using VLOOKUP

I have 4 columns "Column1", "MOVIE_ID", "AVERAGE_RATING" and "RESULT".
I want to check if the row in Column1 has the same data in "MOVIE_ID", and if the data is the same, I want to print show the AVERATING_RATING data again in "RESULT".
For example: if A2 matches any data in MOVIE_ID (in this case it will match B11), I want to print the adjacent AVERAGE_RATING (C11) in the result (D11) which is one the same row of the found MOVIE_ID.
I have this currently =VLOOKUP(A2;$B$2:$B$5001;3) but it doesn't work and I'm not sure why.
This is not easily possible, in the way you ask, because you want to use a variable field in the column A to match a field in the column B and display the result in the same row of B. But you cant set a variable result cell. So the result will be displayed in the cell where the function is.
But fortunately we have an equality relation, so we can switch the variable field and the search column. So we got the function:
=VLOOKUP(B2; $A$2:$C$11; 3; FALSE).
B2 is the variable lookup value.
$A$2:$C$11 is the constant Matrix.
3 is the column index (beginning by 1) of the result value.
FALSE is for a exact match.
So the value of B2 will be searched in the column A.
IF there was a equal value found, the value from the C column will be displayed as a result
ELSE #N/A will be displayed.

Excel index match to return laegest value from multiple matches

I am trying to index match some data into a table but as there are multiple matches Im not getting the match i need which would be the match with the largest value.
I have tried using maxif and lookup but had no luck as of yet with getting it to work.
One table has item number only, the next has item number, price and quote date but the same item can have up to 10 rows with different pricing/dates.
I'd like to pull in the most recent quote date with the item in table 1.
Any help would be much appreciated!!
I tried this concept before like this...
First approach:
I added a column which has the following formula (assuming that id in B:B) (put this formula in D:D column)
=A1 & "-" & countif(A2:A$999,A1)
for the childs table so i made custom index for every single row
and then in the master table (assuming you want to show the value of C:C)
=INDEX(Sheet1!C:C,MATCH(A1&"-0",Sheet1!D:D,0))
Second approach:
will be to use the new MAXIFS formula but you will need a newer excel version
for this approach you will need a sequent index column which just has the row number 1,2,3
and then use this formula:
=INDEX(Sheet1!C:C,MAXIFS(Sheet1!A:A,Sheet1!B:B,A1))

Use VLOOKUP with split ranges

I'm making a formula that looks up a value and returns a value, fairly simple procedure as I can use VLOOKUP or INDEX-MATCH. However, I cannot seem to create or find a way to make it work when the ranges are located side by side. (Will provide example)
I know I could move all the data into two columns, but that would make it Very long and the table is often looked at for reference. I would like to keep the table the way it is.
What I am looking for is that I can type the tank level(inches) into a cell and next to it it will return the tank level(gallons).
My current formula is
=INDEX('Calib. A & B'!$B$3:$B$47,MATCH(TANKS!$E$2,'Calib. A & B'!$A$3:$A$47,1))
Currently it compares cell E2 with A3:A47 and returns the corresponding value in B3:B47. It needs to search columns C, E, G, I, etc. Any ideas other than rearranging the spreadsheet?
There are different ways of obtaining the relevant rows/columns for the lookup:
=INDEX('Calib. A & B'!$A$3:$U$47,AGGREGATE(15,6,1/((TANKS!$E$2='Calib. A & B'!$A$3:$U$47))*ROW('Calib. A & B'!$A$3:$U$47)-2,1),AGGREGATE(15,6,1/(TANKS!$E$2='Calib. A & B'!$A$3:$U$47)*COLUMN('Calib. A & B'!$A$3:$U$47)+1,1))
The -2 for the rows argument of the index function is to adjust for the header position.
The +1 for the columns argument is to return the value one column to the right of the cell that matched.
This assumes, of course, that the values matching the lookup_value in E2 are only found in the "odd" columns of the data range.
As suggested by #TerryW, if your measure in E2 is not an exact match to the value in the data table (and the data table measurements are exact to the 1/8), you can roundup E2 to the next 1/8th.
Replace TANKS!$E$2 with ROUNDUP(TANKS!$E$2*8,0)/8
One way is with a long formula basically doing a union of results of the match on each column but having result as empty string when do not match it.
So we do a match against column A, if it doesn't find it it returns a blank string, if it finds it returns the number , then does the same for column C and concatenates the results and uses this on the index.
BUT this will only work if you search for an exact match.
For example:
=INDEX('Calib. A & B'!$B$3:$B$47,IF(ISNA(MATCH(TANKS!$E$2,'Calib. A & B'!$A$3:$A$47,0)),"",MATCH(TANKS!$E$2,'Calib. A & B'!$A$3:$A$47))&IF(ISNA(MATCH(MATCH(TANKS!$E$2,'Calib. A & B'!$C$3:$C$47,0)),"",MATCH(MATCH(TANKS!$E$2,'Calib. A & B'!$C$3:$C$47)))
You would need to add one more section for each column.

Validation by Using CONCAT in COUNTIF

I want to concatenate the value of two columns in the current sheet and then result should be compared with the concatenation of two column value in another sheet.
e.g - The entered value in Column W and X in current sheet after concatenation should be compared with the existing value in column Y and column Z(after concat) of another sheet.
I have tried using the formula COUNTIF(Sheet2!CONCAT($W$2,$X$2:$Y$2,$Z$2),A2)>0 and some different alteration in this but it seems COUNTIF has range and criteria as argument and this is string which is causing error.
If you want to compare, a simple '=' will do.
Concatenation can be done using '&'.
in current sheet:
=W1&X1=Sheet2!Y1&Sheet2!Z1
will return TRUE if both concatenations are equal and FALSE if they are not.
To find the value W1&X1 in the entire range, I suggest you use a help column (unless you are willing to write a macro). In the help column of sheet1, you concatenate the values (=W1&X1 - drag down). In the hlep column of sheet2 you do the same. Then you make an additional column to check for matches, by using
=match(ValueHelpColSheet1,HelpColSheet2,0)
This formula returns the row number in which the match is found and an error when the corresponding value is not found. You can replace this error with something else using IFERROR if you want to.

Excel Index Match with multiple criteria and multiple results - Return first result

I am using index(match(match to find a value based on two different criteria. There are many results that will populate, I just want to return the first result. What do I need to add to my Index Match formula in order to return the first result that matches?
Below is my code and a breakdown with images:
=INDEX(Master_Query[Current Balance On Hand],MATCH('Waterfall 2018'!$R$1086,Master_Query[Part Number],0),MATCH($BX$1,Master_Query[Date],0))
Cell H1086 is were i need the result to return. I need it to match the highlighted criteria: Part Number in cell R1086 and Date in cell BX1
This is the table that we get the results from, as you can see there are many results that match the criteria in the formula, i just want to return the first one since they are all the same.
Note: The date column is filtered; there are multiple dates that will result in different "current balance on hand"(column D) results, thus I cannot use a vlookup formula. I just filtered it to make it easy to understand my problem.
Attempt 1
Attempt 1(2)
The second Match looks for the column number in the index formula. So it doesn't do what you want.
One alternative is to add a column to the ELX forecast table that merges the "Date" column and the "Part number"
The formula of that column would be:
After that, in your waterfall sheet, replace your current index/match formula with:
=INDEX(Master_Query[Current Balance On Hand],MATCH(BX$1 & $R1086,Master_Query[Merged column],0))

Resources