Conditional formatting for contains certain text from a range of values - excel

How do you do conditional formatting to find out if range 2 contains the text value from range 1? For example check for Apple in red apple should highlight it.
I need to compare A3:A6 with C3:C7. The end result should be C3, C4 and C5 highlighted.
A B C
1 Range1 Range2
==========================
3 Apple Red Apple
4 Orange Green Apple
5 Pear Orange
6 Watermelon Banana
7 Kiwi
I tried this formula but it only check B3 against Range2 and skips B4 to B6.
=FIND($B$3:$B$6,C3)>0

It is possible and I had fun working on this problem but I really wish you had done some work as well - seeing your own effort would have been just as rewarding as solving the problem by myself.
The formula to be used with conditional formatting is:
=NOT(ISERROR(AGGREGATE(15, 6, ROW($A$1:$A$4)/SEARCH($A$1:$A$4,B1), 1)))=TRUE
It obviously works as a normal, non-array formula too:

Related

How do I highlight a cell in Excel when all its content is contained in another column

I have a column (column A) that contains a list of text and another column (column B) that contains a smaller list, which is the values that I actually care about. Is it possible to only highlight cells in column A if all of its contents is listed in column B? If so, how?
A B
Apple Apple
Peach Pear
Apple, Pear Plum
Apple, Grape Kiwi
Apple, Pear, Kiwi      
Watermelon, Grape
So in the above example, I would like to highlight A1, A3, and A5 because all of the contents is listed somewhere in column B
use the following formula for the Conditional formatting:
=AND(ISNUMBER(MATCH(FILTERXML("<a><b>"&SUBSTITUTE($A1,",","</b><b>")&"</b></a>","//b"),$B:$B,0)))
If one does not have FILTERXML then they can use:
=SUMPRODUCT(--ISNUMBER(SEARCH("," &$B$1:$B$4&",",","&SUBSTITUTE(A1," ","")&",")))=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1
Noting that the range $B$1:$B$4 must be the size of the lookup values without any blanks

Excel - Find if a product changed price

How can I find if a product changed it's price in excel? For example:
Yesterday's prices:
Potatoes 5,50
Tomatoes 7.40
Apples 5.60
Cucumber 4.30
Today's prices:
Potatoes 5,50
Tomatoes 5.20
Apples 5.50
Cucumber 4.30
Tomatoes and apples changed their price. How is it possible to highlight those changes based on "A" column product description?
This formula will return TRUE if an item in the list has changed price:
=COUNTIFS($A$1:$A$8,A1,$B$1:$B$8,"<>"&B1)>0
Enter it in C1 (in this example) and drag down
Here is what you can try. I also attached some pics for your reference.
Columns A and B are for yesterday's prices, columns C and D are for today's prices, and column E is to see the price changes (you don't need column E but I just want to show you so you know what is happening). Also, the formula for column E is =INDEX($A$3:$B$7,MATCH($C3,$A$3:$A$7,0),2)-$D3.
To highlight whichever product had price changed. We will use Conditional Formatting which is under Home > Conditional Formatting > New Rule > Use a formula.... Under cell D3, you enter the same formula like in cell E3 which is =INDEX($A$3:$B$7,MATCH($C3,$A$3:$A$7,0),2)-$D3. Pick the color you want as the pic sample below.
Then applies to =$D$3:$D$6 just like the pic shows below.
This should work for you. Try and let me know.
Use the conditional formatting on another column. E.g. have a column of Yesterday-Today and highlight if <> 0.
This will work, use the formula
=IF((AND(A1=C1,B1<>D1)),"yes","no")
where A1, C1 have fruite and B1, D1 have prices.
Below is the result obtained.
Potatoes 5,50 Potatoes 5,50 no
Tomatoes 7.4 Tomatoes 5.2 yes
Apples 5.6 Apples 5.5 yes
Cucumber 4.3 Cucumber 4.3 no
Then you can filter/highlight based on whether it is a yes/no.

Excel SumProduct with if Statement in a cell.

I have a basic problem in Excel. I have a row with names and one with numbers. I try to find what is the sum of these numbers for a special name.
ex.
A B
Apple 12
Apple 12
Kiwi 9
Apple 4
Banana 51
Kiwi 12
Banana 4
Kiwi
So far I just use a basic sumproduct which works well. Like
=Sumproduct((A1:A8=A1)*(B1:B8)
This formula gives me back my total number of Apples
(12+12+4).
The problem is, if a cell contain some formula, then I have #VALUE! result.
Let say the last cell called Kiwi contain a code like
=if(A64="", "", 12)
Then it makes Kiwi empty if A64 is empty. Great.
But sumproduct don't work anymore.
I can't sort the name... any ideas?
Thank you
You can simply use =SUMIF() formula to get sum of these numbers for a special name.
=SUMIF($A$1:$B$64,A1,$B$1:$B$64)
or
=SUMIF($A$1:$B$64,"kiwi",$B$1:$B$64)
You can change these ranges based on your list. (You can even define dynamic name in Name Manager and then you can use that Name as your range.)
It's not the fact that your cell is calculated (contains a formula), it's because the result of the formula is a text.
Maybe you could use à 0 instead of the 0-length text and apply conditional formatting to your cells (font colour white if 0 value)
=if(A64="", 0, 12)

Excel Conditional Formatting Formula

I am trying to make a column do this: so lets say
If the score of 4 is made from a 2 x 2 then it is green.
If the score of 4 is made from a 4 x 1 or a 1 x 4 then it is yellow.
I am done the formula for the green and the yellow but it only happens once. So if I change a 2 x 2 to 4 x 1. It will stay green. Not change to yellow.
Formula for Green (2x2):
=IF(G31=4,IF(D15=2,IF(F15=2,0,1),1),0)
Formula for Yellow (4x1, 1x4):
=IF(G31=4,IF(D15=4,IF(F15=1,0,1),1),0)
Please help me work this one out. Thank you.
enter image description here
Tried the formula but does not work, even if I remove every other formula:
enter image description here
Use a combination of AND and OR
Formula for Yellow (4x1, 1x4) =AND($G31=4, OR($D15=1, $D15=4))
Formula for Green (2x2) =AND($G31=4, $D15=2)
EDIT
As per your screenshot, if you are trying to change a range, not just cell G31, use the following:
Formula for Yellow (4x1, 1x4) =AND($G1=4, OR($D1=1, $D1=4))
Formula for Green (2x2) =AND($G1=4, $D1=2)
Change the number 1 for the starting row of your cells (3, 4, 5 whatever) and set the Range to be =$G$1:$G$100 again changing the 1 and 100 for your start and end row.
I cannot stress enough, if your data does not start in row 1, you will need to edit the above to suit your needs.

I want to give same number to the duplicate data in excel

I want to give same number to the duplicate data in excel
A B
apple 1
apple 1
apple 1
ball 2
bat 3
dog 4
dog 4
goat 5
Sort your column A then insert the number 1 in cell B2 and the following function in cell B3 and copy down.
in cell B2=1
function in cell B3: =if(A3=A2, B2, B2+1)
Update
It is also possible to do it in a dynamic way that does not require sorting.
Paste the following formula in B2 and copy down the column:
=IFERROR(INDEX(B$1:B1,MATCH(A2,A$1:A1,0)),MAX(B$1:B1)+1)

Resources