Conditional Format in Excel when adjacent cells are equal - excel

I have numbers stored in cells D5:S19. Each row of this array represents a specific product, the number in each column represents the cost of this item in a given financial quarter (if the product is not available in a given quarter then the cell is blank):
I'm struggling with setting up a conditional format which will highlight the cells which are adjacent and equal on a row by row basis (excluding the blank cells). I have tried using a formula based around the EXACT function (EXACT($D5,$E5)) for the entire array but this doesn't seem to work at all.
Any pointers here would be greatly appreciated. Thank you.

The way I see it, your highlighted data is going to be in one of three states. It is either:
The first entry of several consecutive entries
The last entry of several consecutive entries
Somewhere in the middle.
This lends itself to three distinct conditional formatting rules, to make sure that the use can distinguish between different sets of consecutive values. These come through as follows:
Notice the borders specified for each rule. We then order the rules in reverse order, and set rule 3 to "Stop if True". This means that left and right borders aren't added to our middle cells, like so:
This results in the following conditional formatting (I have only used a subset of your data)
Here's a text version of each of the rules for you to copy:
=AND(D5<>"",D5=E5)
=AND(D5<>"",D5=C5)
=AND(D5<>"",D5=E5,D5=C5)
Hope this helps!

Related

Create a list of items that exceed a certain criteria with cumulative calculation

I need to create a list from this data set that shows item#, qty, and date needed. The main criteria would be the inventory quantity (column B) and I need the list to show what date the cumulative sum of each row exceeds that quantity in column B. The highlighted cells is the data I would like to have listed out with the date they correspond with in Row 1.
If you have Office365 you could use:
=IFERROR(INDEX(C$1:H$1,XMATCH(TRUE,SCAN(0,C2:H2,LAMBDA(a,b,a+b))>=B2)),"enough inventory")
You can achieve using two Conditional Format Rules. However, I was only able to accomplish this by inserting a blank column after Inventory. So, column C is a new blank column.
Select your data (D2:J5 in my case) and input these two conditional format rules:
=SUM($D2:D2)>$B2 --> (format as yellow fill)
=AND(SUM($D2:D2)>$B2,SUM(C2:$D2)>$B2) --> (format as no fill)
The first rule will perform a cumulative sum and highlight the first instance plus everything to the right when the rule is triggered.
The second rule basically "unhighlights" everything to the right of the first instance.
You need to arrange the rules so that rule 2 runs first, as seen in the picture.
It's odd that it works this way, specifically arranging in that order, but it worked on my PC.

Excel 2013 - Alternate Highlight Rows Based on Cell Data CHANGING

I don't know much about conditional formatting in Excel. I'd like to be able to use the background color of rows to indicate "groups" of rows. One of the cells (all the same column) determines which "group" the row belongs to. I don't want to associate 1 color per group; instead, I'd like to alternate between 2 (or more?) colors. So, I am content to say, "switch colors when the value of this column changes". (I realize that will only work if I'm sorting on that column, but I am sorting on that column.)
This feels like it should be dead simple, but I haven't been able to figure it out, or even figure out how to google for it.
Here's a solution which doesn't use a helper column:
Rule 1: =MOD(SUMPRODUCT(1/COUNTIF($O$1:$O1,$O$1:$O1)),2)=1
Rule 2: =MOD(SUMPRODUCT(1/COUNTIF($O$1:$O1,$O$1:$O1)),2)=0
Important: This assumes that all instances of account numbers are always grouped together - for example it will fail if O7 is changed to "Account 1". I assume this is not an issue since you are sorting on Column O.

Multiple Responses in Excel's Reverse Lookup

I'm trying to make a schedule of available workers after they have given me their availability. I would like a list generated of all people who say they can work on a specific day.
Ideally I would create some kind of list that looks like this:
I'm actually trying to schedule volunteers for my swim team, not employees, but the idea is the same. The form that they are filling out can also have blank spots (not shown in data table above, but possible) and the dates in the first column will also be out of order. I can manually fix both of those things, but if there is a solution that does not require me to fill in the blanks or sort the dates that would be ideal. I'm using Excel 2019 on a Win10 PC.
Starting in I2 you would have
=IFERROR(INDEX($B$1:$G$1,AGGREGATE(15,6,COLUMN($B$2:$G$7)
/(INDEX($B$2:$G$7,MATCH(I$1,$A$2:$A$7,0),0)="yes"),ROWS($1:1))-COLUMN($A:$A)),"")
so you are finding the right row in B2:G7 by doing a match on the date in column A, then finding the first, second, third... column which has a Yes in it, and finally getting the matching name from the first row.
You can see what's happening by stepping through the formula with evaluate formula:
(1) find the right row in B2:G7 by index/match
It's matching the date (stored as a number, 43466) against the list of dates in column A. The matching position is 1, which gives the row, and the column parameter in the Index function is 0 so you get the whole row.
(2) Find which cells contain 'yes'
The values in the array which do contain yes will be replaced with true and the ones which don't will be set to false.
(3) Do the division
This is the crux of the whole thing. What aggregate is going to do is to ignore the #div/0 entries (because we used option 6) and work out the lowest (minimum) column which corresponds to a 'yes', which is 2. It's the lowest because rows($1:1) just works out to 1 so you get the 'first smallest'.
(4) Adjust the column so that you get it relative to the first column of B2:G7. You could just subtract 1, but I'm trying to make it so that it still works if you insert a column to the left of the range.
5) Then all that's left is to index into the list of names in B1:G1
ending up with Albert.
As the formula is pulled down, rows ($1:1) changes to rows ($1:2) etc. so you get the second smallest column with a yes in it and so you get the second name. Eventually it errors out when there are no more matching names so IFERROR comes into play and you get a blank cell.

Conditional formatting based on two quantity columns (Excel)

I'll try to be as specific as possible.
I want to compare an array of different codes (Quantity Needed). A column that contains the same code multiple times, and each of these needs to be compared to the value of a single cell in another column, that contains that code only once (Stock Qty).
To be more specific,I need to compare the quantity needed of said specific code (which is located in a cell next to the code) to the quantity in stock of said code (which is located in another table).
Then I need said 'Quantity Needed" cell to turn either Green (if the number on the Stock Qty column related to that specific code is equal or bigger than the number on the Quantity Needed cells for that code) or Red (If the number is less).
I could do this with conditionals one by one but the amount of codes is very large.
Image for further comprehension: https://snag.gy/EnzGWc.jpg
Thanks.
You can use conditional formatting with formula. goto conditional formatting=>New rule=>formula. There enter this formula =D3-VLOOKUP($B3,$H$3:$I$10000,2,FALSE)<0 . Set applies to =$D$3:$D$10000. Adjust range to fit all values in columns.

How to sanitize a collated column with text and numeric data to make it uniform for easy analysis in excel 2007

I have 3 column heads and I wanted to collate it with 3 similar heads from another sheets. 10% at an average from each of the 6 columns is blank, I have to map the data based on these 3 columns to other data and I need them to be sanitized. So there are the blanks and then there are some cells which have text like 208110185726A570-14. Please help.
Haven't heard back from the comment above, but I'll have a go at this anyway (and will be using assumptions that may be incorrect):
Given that you have included the tag vlookup, I'm assuming that you want to build a table that uses the leftmost column as an index of unique values to conduct a VLOOKUP. If that's the case, I don't see any way around blank cells in the leftmost columns in the two sheets, other than saying that the ensuing VLOOKUP would skip over any row that had a blank leftmost cell.
If you can live with that, the way I would go about it is pretty simple:
Copy the columns from one group (omitting the header row) and paste them to the end of other group. Again, since you have mentioned VLOOKUP, I'm assuming that keeping the cells in the rows next to each other is the goal (i.e. you can't remove the blanks in the columns because otherwise that would mess up the horizontal integrity of the cell relationships).
Do your VLOOKUP. Again, I'm assuming unique values in the leftmost column. This assumption is important, because it will make a difference to the decisions you make about what type of VLOOKUP you use (range vs. exact match) and what value is returned. For example, if you use exact match and there are repeating values, it will return the 1st match it finds.
Again, the assumptions might be wrong, but the question is a little unclear.

Resources