Excel 2016: Conditional Formatting: Highlight row if cell value is in list - conditional-formatting

Excel 2016 Conditional Formatting question:
I have two tabs, Data and List:
Data has 5 columns. Column A is the item ID number, the others have
project related data.
List has 1 column. This is a list of ID numbers
that have been processed.
Here is the question:
How do I highlight the rows for processed ID numbers? I want to be able to add ID numbers to List as I process more rows. I want to see processed items in Data in green highlight, because green makes the boss happy!
Looking forward to your input!

I would use a VLOOKUP to find the value in the List sheet. An error means the value doesn't exist. Since you want to know if it does exist, just invert the boolean result with NOT
=NOT(ISERROR(VLOOKUP($A1,List!$A:$A,1,FALSE)))
Note: This is a Classic > Formula formatting rule, and the lookup value is $A1 because my "applies to" range starts on row 1 (and we always look at col A).
Rule:
Formatting Range:
Result:

Related

Find number of rows in an already filtered Column A in Excel

I have got an Excel spreadsheet. This spreadsheet has just one tab in it. The Tab name is dynamic in nature and changes every week also the number of rows.
I have column A filtered already with a VBA macro. A1 has the header.
Now, I wanna find how many rows are there in this already filtered column A.
I am looking for any VBA function.
I have tried using Subtotal function.
=Subtotal(103,A2:A1345)
But I don't know the end range. As of now the end range is A1345. It will change every time in future if the new rows are added.
I tried multiple things but those did not work. I am quite new to VBA.
If A1 will never be blank, you could use (in a column other than A)
=Subtotal(103,A:A)-1.
Or, if there will be data below your table not to be counted, then format your table as a Table and use structured references (and this formula could go into column A)
=SUBTOTAL(103,Table1[column_header])
You can put the formula in column A if you use another column's last populated cell as the demarcation point.
If column B contains numbers then,
=subtotal(103, a2:index(a:a, match(1e99, b:b)))
If column B contains text then,
=subtotal(103, a2:index(a:a, match("zzz", b:b)))

How to count occurrence of each sentence in Excel in this specific case?

The challenge here is the sentence is not split by cell. They are in the same column, but they might appear in the same cell. One sentence per line.
I need to count the occurrence of each sentence, for example, occurrence of "The cat is pink" is 2 and occurrence of "The dog is green" is 1.
I can also do Access 2016 if needed.
(Assuming you can split multi-sentence cells into multiple cells)
1) Split the cells with multiple sentences, you should be able to adapt this code to do this.
2) Make a copy of the column (elsewhere on the same sheet or in another sheet -- used column B in the same sheet),
3) Remove duplicate values for the copied column
4) Next to the column use the following array formula:
{=SUM(LEN(A$1:A$5)-LEN(SUBSTITUTE(A$1:A$5,B1,"")))/LEN(B1)}
(press <CTRL><SHIFT><ENTER> when entering an array formula)
sort column A --> a-z then
add a header to column A (to use in subtotals)
then from the Data tab, use "subtotals" using "count" as the function
=COUNTIF(A:A,"*Cat is Yellow*")
The same formula can be applied for all the rows.

Extracting "hidden" data from expanding/collapsing pivot table - Excel

I'm not sure if this is possible but as you can see I have a pivot table with multiple dependent and expandable fields. I am trying to concatenate the data from columns A:D into one cell which works fine in row 2 but doesn't work with blank parent cells, as you can see in column F.
Any ideas for how to achieve this?
Pivot table
This answer assumes that you don't want to just Repeat All Item Labels in the PivotTable from the "Report Layout" drop-down on the Pivt Table Tools "Design" tab.
A formula to get the first non-blank value on or above the same row as the current cell from Column B can be constructed with a combination of AGGREGATE, SUMPRODUCT and OFFSET, like so:
=OFFSET($B2,SUMPRODUCT(AGGREGATE(14,6,ROW($B$1:$B$100)*--(ROW($B$1:$B$100)<=ROW())*--(LEN($B$1:$B$100)>0),1))-ROW(),0)
How does it work?
Starting with the outermost part, OFFSET($B2, VALUE, 0) - this will start in cell B2, then look up or down by VALUE rows to get the value.
Next we need to know how many rows we will need to look up-or-down. Now, if we can work out the bottom-most row with data, we can subtract the current ROW() from that, giving us OFFSET($B2, NON_BLANK-ROW(),0)
So, to finish up we need to work out which rows are not blank, AND which rows are on-or-above our current row, then take the largest of those. This is going to take an ArrayFormula, but we can use SUMPRODUCT to make that calculate properly. To find the largest number we could use MAX or LARGE - but we get less errors if we pick AGGREGATE(14,6,..,1). (The 14 means "we want the kth largest number", the 6 means "ignore error values", and the 1 is k - so "we want the largest number, ignoring errors")
But, what list of numbers are we going to look at, I don't hear you ask. Well, we want the ROW for output from our range (I'm using $B$1:$B$100, because using the whole column B would take far to long to calculate repeatedly), a comparison against the current ROW(), and check that the LENgth is > 0. Those last two are comparisons, so let's write them out first:
ROW($B$1:$B100)<=ROW()
and
LEN($B$1:$B$100)>0
We want to use -- to convert TRUE and FALSE to 1 and 0 - this means that any "bad" values become 0, and any "good" values are larger than 0:
ROW($B$1:$B$100)*--(ROW($B$1:$B$100)<=ROW())*--(LEN($B$1:$B$100)>0)
This gives us the Row number when the Row is on-or-before the current row AND Column B is not blank - if either of those are False, then we get 0 instead. Stick that in the AGGREGATE to find the largest number:
AGGREGATE(14, 6, ROW($B$1:$B$100)*--(ROW($B$1:$B$100)<=ROW())*--(LEN($B$1:$B$100)>0), 1)
Then put it in a SUMPRODUCT to force Excel to treat it as an ArrayFormula, and that's your NON_BLANK. This then gives you that first formula right at the top of the post

Excel 2013 conditional formatting using a formula

I have a spreadsheet in Excel 2013 with Location in Column A, Material Number in Column B and types or groups of materials sorted by material number in Column I J & K. Other columns contain data that is irrelevant here.
Column B can contain the same material number in multiple cells.
I'm trying to find a simpler way to format font and color of the items in Column B by comparing if the item is located in Column I J or K, or not at all (no formatting in that case).
I was entering an individual conditional rule to compare Column B with the value in cell I3, another rule for I4, another rule for I5 and so on.
This is getting unwieldy due to the number of items now in I J & K.
There has to be a simpler, more elegant way to do this. Conditional formatting using exact match is not letting me select a range of cells for the match value.
I just need to format the text in Column B to Bold and Blue if the number exists in Column I also, or Bold and Red if it exists in Column J or Bold and Green if it exists in Column K.
Set up a conditional formatting rule that uses a formula. The formula can contain a Countif function that counts how many times the value in cell B in the current row is counted in column I. For example, starting in row 2, select B2 and add a formatting rule with the formula
=COUNTIF($I:$I,$B2)
Take care to use the current row number in the formula and don't use a dollar sign $ in front of the row number. Set three rules, one for column I, one for J and another one for K.
You don't need a new set of rules for each row. Just apply the three rules to all the rows required.

Dynamic reference in excel formula

I have the following array formula which works for what I want to do but I'm trying to change the formula when a user selects a value.
=INDEX($A$2:$B$70,SMALL(IF($A$2:$B$70=$A$121,ROW($A$2:$B$70)),ROW(1:1))-1,1)
It's used for a monthly report and the user will choose from a drop down the day of the month, e.g 1,2,3 - 31.
So if the user selects 1 from the drop down menu I want the formula to use the above formula.
If they select 2 for example I want the formula to move over a column so it would change to
=INDEX($A$2:$C$70,SMALL(IF($A$2:$C$70=$A$121,ROW($A$2:$C$70)),ROW(1:1))-1,1)
and so on moving over a column at a time.
It this possible at all or can it even be done without VBA?
I have an example of what I want done on the following link
https://docs.google.com/spreadsheets/d/1MDOzoQxYLgW-UOyljZsMwSu8zyAB7O2k1V-bTNP5_F0/edit?usp=sharing
All the data is on the first tab called staff. Each employee has a row and the duty assigned under the corresponding day column.
On the Roster tab it summarises each day. So what I am trying to get to happen is when you choose the day of the month (or preferably the actual date) the sheet changes to reflect the data.
At the moment the code I have working does for just Day 1 because the column references are coded into the formula. I was hoping to somehow choose 6 for example from the drop down and then the formula will map chosen day to the corresponding range in the raw data and update the formula and change the formula from Staff!$A$2:$B$68 to Staff!$A$2:$G$68.
If the formula finds no more entries if shows #NUM! but I intended to use the function ISERROR() to replace #NUM! with "".
This is what I'm trying to achieve it if makes sense?
There are a few issues here/ You are returning the value from column A so the first range can be $A$2:$A$70 and that means you don't need the 1 to specify the column_num. The IF statement was covering A2:C70 when you really only want either B2:70 or C2:C70 depending on the 1 or 2.
Assuming that A122 has either a 1 or 2 in it then,
=INDEX($A$2:$A$70, SMALL(IF(INDEX($B$2:$C$70, 0, $A$122) = $A$121, ROW($1:$69)), ROW(1:1)))
Standard non-array alternative,
=INDEX($A$2:$A$70, SMALL(INDEX(ROW($1:$69)+(INDEX($B$2:$C$70, 0, $A$122) <> $A$121)*1E+99,, ), ROW(1:1)))