check multiple cells value in a sorted list have same value as another manual cell - excel-formula

How to write a formula in excel that based on critria it can check if list of multiple result cells have same value.
I attached example:
Look for all cell with the number 100
Verify that the list of these cells contain same date value of one cell.
I try to use formula such as: COUNTIF + INDEX and MATCH but didn't work as expacted.

I'm guessing you can use =ROWS(FILTER(....)) but what I would do is create a hidden column that evaluates it per row, maybe with something like
=IF(A2="","",XLOOKUP(A2,A$2:A,B$2:B)=B2)
and copy that formula down the column.
This way, you can not only see if there are any bad values (by COUNTIFS for false values where the A-column's value matches the "find these cells" value) but apply conditional formatting as well to highlight the bad values.

Related

Use a combined formula to return the value of a cell

I am trying to obtain the value of a cell that is in a different sheet, from a formula that returns the value of the row where it finds a match.
Basically, what I'm trying to imitate is:
=Sheet!Column Row
But as follows
=Sheet!Column Formula (Which returns the row that meets the conditions of the formula)
The problem is that I tried concatenating the name of the sheet, the column and the result of the formula (row), which works, since I get, for example:
=Risks!K3
But that's all, I get a kind of string and in reality I would need that result to also be calculated by excel and return, precisely, the value of cell K3.
Is there any way to solve it?
Use INDEX:
=INDEX(Risks!K:K,formulathatreturns3)

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:

Excel: formula to return a value based on another cells value

I have a spreadsheet where one column contains cells with text of 4 characters in length. My logic is:
If the cell contains 1111, then place F2mg in another column cell, or,
If the cell contains 2222, then place M3TNT in that other column cell, and so on.
There are many of these instances. What would be the easiest way to do this?
Use a VLOOKUP table. Here's a quick example:
VLOOKUP has the following format/interface:
=VLOOKUP(lookup value,
range containing the lookup value,
the column number in the range containing the return value,
optionally specify TRUE for approximate match or FALSE for an exact match)
Consider reviewing a detailed example and video on how to use VLOOKUP.

How to select a VLOOKUP row based on multiple column values

We have 11 columns (Columns B through L) of codes that I need to select based on a VLOOKUP from another sheet. IF ANY of the column values are "HI" or "EXT", I need to keep the record, if ALL of the column values are "M" I can exclude it. Column A is my LOOKUP list.
Right now the best I can come up with is 11 nested =IF(VLOOKUP(...) statements to set an inclusion flag, but if there's a way to SUM a TRUE/FALSE flag based on equality to the value "M" across all 11 columns...I've not had success finding that.
Any ideas?
This can be solved in two steps:
For columns B-L, the formula needs to be your VLookup formula (which you didn't put here) and ="M" at the end of it, which will result in a binary true/false value.
Then, in column M, simply do a logical AND using the AND function across B-L for each row e.g. =AND(B1:L1)
Another option, if you wish to keep the display format the same, is to do an array formula.
Enter =IF(AND(B1:L1="M"), "KEEP", "EXCLUDE"), then press CTRL+SHIFT+ENTER and it will add curly braces to it, meaning it calculates an array value. The resulting formula in the cell will be {=IF(AND(B1:L1="M"), "KEEP", "EXCLUDE")}. I tested, and it appeared to work as expected.

Resources