Use Two Different columns to compare to another worksheet - excel

I have two columns that are different from each other. One containing numbers and the other containing text.
Trying to compare (match) both to another separate worksheet.
Of course, I can VLookup each one separatedly but that doesn't give me the answer I'm looking for.
I want to know if the first two columns correlate with the other worksheet.
I also tried an IF(VLookup but probably did it wrong.
To sum it up. If Column A and Column B are both on the other worksheet, then True or False.

Here's a worksheet function that'll do what you want assuming you're only looking in 1 column on worksheet 2. Just replace the values in [] with the actual ranges:
=NOT(OR(ISNA(MATCH([ColumnA],[OtherWorksheet],FALSE)), ISNA(MATCH([ColumnB],[OtherWorksheet],FALSE))))
Here's an example using actual ranges:
=NOT(OR(ISNA(MATCH(A1,Sheet2!A:A,FALSE)), ISNA(MATCH(B1,Sheet2!A:A,FALSE))))
FYI: You could also use this formula for conditional formatting if you don't want to display it in a cell.
Just to explain it:
MATCH will return a number if the value is found, otherwise it will be #N/A.
ISNA will indicate if the result was #N/A.
OR will result in TRUE if either nested ISNA indicates TRUE. (Meaning 1 value wasn't found)
NOT flips TRUE to FALSE and vice-versa.
End result, if both values are found returns TRUE otherwise displays FALSE.

Related

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.

Conditional Formatting using multiple vlookups

I have an excel spreadsheet and I am trying to do conditional formatting based on multiple conditions. I have to highlight the rows where (Column A value matches column C) AND (Column B matches column D). I tried 3 ways but none of them are giving me expected results-
Method 1 - I tried conditional formatting with these 2 Rules-
(VLOOKUP($A2,C2:C93,1,FALSE))>0
(VLOOKUP($B2,D2:D93,1,FALSE))>0
and applied it to $A$2:$D$5745
but this is not working as expected.
Method 2- I tried using if but this is also not providing me desired results
=if(VLOOKUP(A2,$C2:$C93,1,FALSE)>0 & VLOOKUP(B2,$D2:$D93,1,FALSE),True,False)>0
applied it to $A$2:$D$5745
Method 3- =AND((VLOOKUP($A2,C2:C93,1,FALSE))>0,(VLOOKUP($B2,D2:D93,1,FALSE))>0)
applied it to $A$2:$D$5745
To rephrase this problem- I would like to highlight all rows where CustEID in Col A and Account EID in cloumn B match CustEID in col C and Account EID in col D.
Can someone please guide me?
Here's what I was able to get working.
The VLOOKUP evaluates to return either the "found" value or #N/A. By modifying your formula with a logical check >0, this converts the result to a boolean value (TRUE) but only in the case where VLOOKUP is returning a valid value. In many of your cases, your formula still evaluates to #N/A.
So this: =VLOOKUP(A2,$C$2:$C$93,1,FALSE)>0 will return either TRUE or #N/A.
I've modified the formula to =IFNA(VLOOKUP(A2,$C$2:$C$93,1,FALSE)>0,FALSE), which forces the entire formula to return a true boolean value TRUE or FALSE.
The cell range references in your formulas need to be locked into specific ranges that will not be evaluated as "relative" in the context of the conditional format formula. So your formula VLOOKUP($A2,C2:C93,1,FALSE) using the range C2:C93 will also "slide" (my own terminology for this formula going "relative") as it progresses down the rows. So each of your formulas needs to lock this down with VLOOKUP($A2,$C$2:$C$93,1,FALSE).
Notice that the only portion of the formula that stays relative is the row number -- the 2 in this case. So you'll start your conditional format setup on row 2.
Combining these formulas for the full test you want to apply gets you
=AND(IFNA(VLOOKUP($A2,$C$2:$C$93,1,FALSE)>0,FALSE),IFNA(VLOOKUP($B2,$D$2:$D$93,1,FALSE)>0,FALSE))
Applying this to your conditional format as a full row requires one last adjustment. Instead of applying your rule to the range $A$2:$D$5745, you have to remove the column references. So the application range becomes $2:$5745.
This is what I get when it's all put together:

Sum all value of row when find a specific word in a column

I want to sum all values of one row (there are a lot of column) if there is a specific value in the first column.
Below follow the problem:
Link with the image
I want to find API Rheology and then find Cond. Time, with verified this two conditions, sum all values of the row.
    
You need to check the value of the first column with an "IF" function, and then if it's true, use "SUM" to find the total.
For example, if your first column is in a1, and your data goes from a1 to z1, than your formula should look like this:
=IF(A1="[check value]",SUM(A1:Z1),"")
Where you replace [check value] with what value you are looking for and "" with what you want to display if the value is not there. Putting "" will leave the cell blank.
If you want to be more specific and check if the first column contains a value, then you need to use:
=IF(ISNUMBER(SEARCH("[check value]",A1)),SUM(A1:Z1),"")
With the same arguments as before.
If you want to find multiple values than you need to use the AND function, so your function becomes:
=IF(AND(ISNUMBER(SEARCH("[check value]",A1)),ISNUMBER(SEARCH("[check value 2]",A1))),SUM(A1:Z1),"")
This will check if cell A1 contains both strings. If you want to check two different cells, then just replace the second A1 with whatever other cell you want.
If you want to find the string within a column of cells, replace the "A1"s with the list of cells you are looking for the string in. e.g. A1:Z1
The reason this works is because SEARCH returns a number based on where the [check value] is found within cell A1, or an error if the string doesn't appear. ISNUMBER returns TRUE if SEARCH return a number, not an error. Finally, IF checks if ISNUMBER is true or false, and returns the sum of your numbers if true and a blank space if not.
Hope this helped.
The sample data image seemed incomplete so I added a few things.
    
The formula in AE65 is,
  
This formula looks down column A for the name of the test (e.g. API Rheology in AC65) then locates the next occurrence of the reported result section (e.g. Cond Time (min) from AD65). Having located that row, it sums columns C:Z.

Searching worksheets to return True or False based on value

I have 2 excel worksheets. The first worksheet has 1 column representing route numbers and 4 columns representing values at 4 stops (see below)
The second worksheet has columns representing route numbers, latitude, longitude and stop numbers (see below).
I want to use the route numbers and stop numbers in the second worksheet to search the matching cell in the first worksheet and return a TRUE or FALSE as to whether the value is 0.
The result using my two examples would look as shown below.
What function would I need to perform this search and return?
Assuming your first sheet is Sheet1, you could use the following formula:
=vlookup($a2,sheet1!$A$2:$E$6,match("Stop"&$d2,sheet1!$a$1:$e$1,0),0)=0
The match will retrieve the column corresponding to your Stop, and the vlookup will match the row corresponding to your route.

If condition1 and 2 are true (cell compare to a range of cells) than show a specific value in excel

I want to create a function when two comparative conditions are True than a cell takes a specific value.
This is the Function i am trying to use:
=IF(AND("City"="List of cities","Product"="List of products")*TRUE,Cell Value,NA())
When i compare a cell with another cell, the formula works fine but when i compare a cell with a range of cells the result is False.
How can I fix this problem?
Assuming List Of Cities and List Of Products are lists composed as named ranges
You can use CountIF
=IF(AND(COUNTIF(List_Of_Cities,"City"),COUNTIF(List_Of_Products,"Product")),"Cell Value","NA")
Take a look at using VLOOKUP or MATCH, in combination with ISERROR
=IF(AND(ISERROR(MATCH("City","List of cities",0))=FALSE,ISERROR(MATCH("Product","List of products",0))=FALSE),"Cell Value",NA())

Resources