Format table rows based on the value in specfic column changing in excel - excel

I have a table with an employee appearing in the first column multiple times, I'd like to colour all rows as the employee name changes. Here's an example of what I'd like to achieve -
I use the following conditional formatting formula for colouring every other row (if there is data) in a different table when I know the data will be changing every row. Is there something similar I can use to only change the colour if the item in the first column changes?
=AND($A2<>"",MOD(ROW(),2)=0)

I would use a helper column as well - but calculating the "ID" of the employee.
Formula in C2
=IF(A2<>A1,SUM(C1,1),C1)
Then you can use the same logic as you showed us in your question: =MOD($C2,2)=0 as your format condition.

I would use a helper column which checks whether the name in the current row is different to the previous one or not. Then use this column in a simple conditional formatting.
=IF(B4<>B5,1-SUM(A4),SUM(A4))

Related

Conditional formatting based on the content of a formula

Long story short: My boss has an Excel spreadsheet for calculating product prices. She has three columns to calculate different margins (so would contain a formula like =cost*.5 etc.), then adds to those values to determine final retail (so would be =column+500). She has her margin columns highlighted different colors and wanted to automatically highlight the final retail cell based on which margin column it references.
I'm sure there's a way of setting up the document from the start that makes this more intuitive, but short of restructuring her entire system, are there any formulas I could use in combination to return a format based on the content of the formula?
I immediately assumed to use "if cell contains specific text" and use the referenced column letter as the text, but excel reads the output for the formatting and not the formula, so I am stumped.
I was thinking somehow to use "isformula", but all the values are formulas just with different input.
Suppose you made table of all the unique formulas that are used:
formula_test, rule,
=cost*0.5,1
=column+500,2
Then you could create conditional formatting rules by formula with one for each unique formula case.
=VLOOKUP(FORMULATEXT(A1),$A$2:$B$3,2,FALSE)=1
=VLOOKUP(FORMULATEXT(A1),$A$2:$B$3,2,FALSE)=2
Where A1 is the first cell in the range where you want the conditional formatting to be applied.
The missing link was "SEARCH":
=SEARCH("=Sum(J",FORMULATEXT(N2))
(J = the referenced margin column, N2 = first cell to apply the final retail formula)

How do I change the color of a row based on specific dates?

The problem that I currently have is, I'm trying to change the color of a row based on a specific date. If the date in the column is less than TODAY() then the row should be Blue, and if is greater TODAY() then the row should be White.
So far I have tried the conditional formatting for it, and it works on a row to row basis but, what I'm trying to accomplish is to be able to make it go across the entire sheet. So for example, if a person adds another row, the condition automatically applies to the new row based on that row inputted date.
The current code that I have tried is a conditional format that is highlighting the row with the following code:
=IF($H$2 > TODAY(), TRUE, FALSE)
Where H is the column of the dates that are manually inputted in by the individual, and highlighting that row. That does work, as I have tested it, but then I would have to do that condition for every row afterwards including new rows that are added into the sheet.
What the results look like currently:
Is there a way to dynamically change specific rows based on date so even if the user inserts a new row, that condition applies to all and only those specific rows that have a date greater than TODAY()?
I have tried the following code but doesn't work properly for what I'm trying to accomplish:
=IF($H$2:$H$7>TODAY(),TRUE,FALSE)
Which the result looks like:
When I want the results to look like the previous image. Is there a way of doing this or would it have to be a row by row conditioning to make this work correctly?
All you really need to do is to remove the $ in front of the row. Then it's a relative reference, so the conditional formatting will consider $H2, $H3, and so on.
Also note that the IF and TRUE or FALSE are redundant; you can simplify to
=$H2>TODAY()

Select all data in Excel by column name, omitting empty cells

The goal is to create a series of graphs that will update automatically based on the raw data.
So, I have created a graph manually and want to edit the formula to accomplish the auto update.
The column names will always be the same, so I want to be able to select all data in a column based on the name BUT ignore any cell that is blank (above zero maybe).
The formula excel has given me so far is
=SERIES(rawdata!$M$1:$M$6,rawdata!$A$2:$A$37,rawdata!$M$2:$M$37,1)
So, something like
=SERIES(rawdata![column name],rawdata![column name],rawdata![column name],1)
I'm not sure how the skipping blank columns should work either. To expand on this further only one of the columns can potentially contain blank values. So if a cell is blank in that column then that entire row shouldn't be plotted, if that makes sense!
strong text =OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B:$B) - 1)
Try this formula when you define the name for the column of values you would like to have data automatically added from. I know it works when each cell has either a formula or a value. Like a column that is automatically calculated based on values in other columns.
In this formula example the cell B2 refers to the first point of data in the column. (make sure your references are absolute! ie, use $B$2)
This automatically returns the range of data as it changes when CountA is added:
=OFFSET(reference, rows, cols, [height], [width])
=COUNTA(value1, [value2], ...)
Hope this helps! It worked for me! :) If you have completely blank cells in the column you might have to make a couple changes though.
-Reverus

Conditional formatting on entire row for grouping

I have an excel report which is grouped by person i.e. The persons name is in the first cell and then all person child data is in this row and subsequent rows. All subsequent rows of the person has the first cell blank. A new person then has the first cell populated again.
I am trying to acheive something similar to a grid with alternate row colours per person wherein the first rows for person 1 maybe highlighted and the second row is not, third person is highlighted and so on and so on.
Can this be handled by conditional formatting?
Thanks
This answers assumes you don't want to use VBA, but only conditional formatting, hence, the solution is limited, but this may be enough. If you will to write some code, have a look here for anthor option.
The basic idea is to create a color-code by the first letters in the person's name, I choose to take the first 3 letters, but you can take more if you wish. So I use a helper column (code) with the formula:
=IF(ISBLANK(B2),A1,CODE(LEFT(B2,1))+CODE(MID(B2,2,1))+CODE(MID(B2,3,1)))
which is then dragged to the end of the table. Then you use some color-range conditional formatting to format all cells in this column based on their values.
Tell me if it solved your problem ;)

Invisible table based on drop-down list value

There is a drop-down list with numbers that was made using Data-> Data validation. The goal is to make visible only the number of rows of the table that was chosen from drop-down list without using vba (to make it more easily to edit by ordinary users). The first column of the table contains numbers corresponding to the numbers from the drop-down list. The table also contains the columns with formulas. I choosed to use conditional formating with idea that all the cells of the table will be calculated and then hide those rows of the table that are under the row corresponding to the value of cell with drop-down list. In other words it needs to dynamically change the visible rows of the table or to dynamically form the table (but there is a columns with formulas and I don't know if you can do that without using vba). I've tried different ways but this problem seems difficult for me. Maybe instead of ordinary table you need to use smart-table or power pivot but I don't have experience of using it. Thank You for Your help!
Ok... let's asume you have the value in A1.
Now for the range of B2:G20.
Conditional formatting formula: =ROW()>$A$1
In the range of B2:G20 every cell will be formated with a row higher than the value in A1
If the format is something like ; ; ; it looks empty.
Using this example and having 11 in A1 -> B12:G20 will be hidden.
However: to set Row.Hdden = true you need to do it manually or use VBA :/

Resources