How to move cell colour when sorting data - excel

In my spreadsheet I have coloured rows but when I sort the data the colours stay in the same place and don't follow the sorted data.
So if row B is red and the data moves to row A after sorting, row B remains red but I want row A to be red because that's where the corresponding data has moved to.
How can I do this?

It sounds like you're using a table and have applied a table style. You need to convert the table to a range, then convert it back. Do the following:
Select a cell in the the table, then under the 'Table Tools' > 'Design' tab, select Convert to Range. Select yes at the pop-up asking whether you'd like to convert it to a normal range.
Highlight the whole table again, the under the 'Insert' tab, select table. Click on ok in the pop-up window.
The formatting should remain consistent now when you're sort the data.

Related

Excel Pivot functionality

Is there a way to remove the aggregate values that appear in the collapsed form in Pivot rows?
Please see the attached screenshot.
I dont want the Sum of the values that appear against a Name if the Row is in collapsed form. I have already selected "Do not show subtotals" but that doesnt remove this. Only when we expand the field, then the values on the header row disappear.
While this doesn't address the specific question, you could change the report layout to Tabular form. Your PT will look like this, where the 2nd named field is empty when collapsed. That may help someone identify when to ignore the numeric columns.
To better identify when to ignore those numeric values, you could also add conditional formatting to the numeric columns (C and D in this case).
Highlight the entire pivot column C and then go to Conditional Formatting... New Rule... Rule Type "Use a formula to determine which cells to format".
In the formula bar within the conditional formatting popup, type: =isblank(b4)
Click on the Format button.
Here you can decide to format the font or cell. Pick a format you want, such as a Gray cell.
Repeat steps above for column D.
Here, I choose a gray cell for Column C, and white text for Column D. Column D looks blank when collapsed, but it's really not.
Here's how the PT will look:

Color excel pivot columns based by column header

I would like to change background colors on the columns in my pivot table based on the header (dimension on the X-axis).
When i click "Banded colums" it just colors every secon column, but i want the behavior from the last table in my example below. It should change every time the year is changing.
In the example the columns are always grouped in pairs two and two, but a solution that can handle variable column-sets would be perfect.
Any suggestions?
Example
Now I understand, I totally misread your question.
Right-click one of the pivottable styles you like and select "Duplicate".
Give the style a meaningful name
Click the First Column stripe item
Set Stripe size to 2
Click the Second Column stripe item
Set Stripe size to 2
OK
Click the PivotTable Styles dropdown and select your newly added style.
Check "Banded columns"
I'd suggest to use a conditional format. Home, Conditional formatting.
Suppose you want to highlight all columns which have "#Rolls":
Select all data columns in the PT, for example cells B4:I20
Click Home, Conditional formatting, New Rule
Select "Use a formula to determine which cells to format"
Enter this formula: =B$4="#Rolls"
Choose the appropriate format by clicking the format button and setting things up.
OK your way back to Excel

Setting Up A Potential Excel Macro

I'm not even sure if this is something you would use a macro to do the second question.
I have a spreadsheet of a list of cards in a card game I play on the PC. So this leads to two questions.
1) Column E is for legendaries. If the column value = 1, then I want the row to be filled a certain color. So IE: row 2, columns A, B, C,D,E all filled with orange.
2) How can I create a text link that will filter anything with a value in column E? Column E is only going to ever contain a "1" if it's present. I want to filter out all the values that are not one. Then how would I clear it?
You can download my Excel workbook if you wish from the following link: https://drive.google.com/file/d/0B0x25Dj52eXBT1dlSFE1YjBXV0k/edit?usp=sharing
Thanks in advance for any help.
For the first question, just use conditional formatting. Select your entire sheet, go to the Home ribbon, click "Conditional Formatting", then click "New Rule." Under "Rule Type," select "Use a formula to determine which cells to format". In the formula box, enter =$E1=1, then click "Format" to edit what you want those rows to look like. Hit "OK" and now all rows where E=1 should be changed.
As for the second question, the simplest way would be to select your header row, then go to the Data ribbon and click "Filter." The when you want to see your legendaries grouped together, simply click the drop-down arrow on column E's header and click "Sort Largest to Smallest." This way you can also sort by the other columns if you want (name, ID, whatever).

How to create dropdown with multiple columns in excel

!
Hi I am using Excel 2003. I need to add data validation to a column, it should display the two columns in the cell, when user selects, the 1st column value should be displayed in cell.
Ex:
Col1 Col2
IND India
CHI China
Column - display to select
Column
IND-India
CHI-China
after selecting CHI the China or CHI will be displayed in the cell.
Is there any possibility to do the process in Excel.
Thanks in advance for any help...
(1)
If you need a dropdown item to display a different title after being selected, you can have another cell serve as the display. For example:
Where B3 (the helper cell) can have a formula like =LEFT($C$3,3) or use INDEX/MATCH to look up keys (like in your 'For Validation' table).
And where C3 (the data validation list) has a custom format like ;;;"(Change)" or "(Select)" or even a symbol like "↓", and will never display the actual selected list item.
You can also do this with VBA by creating an activex combo box control.
(2)
If you need one dropdown list to depend on the selection made in another, you can use dynamic dependent data validation:
http://www.myonlinetraininghub.com/excel-factor-19-dynamic-dependent-data-validation
Go to Devloper tab - insert - active control- insert comobobox
draw comobox in your excel sheet
right click on combobox, open property
in listfill range, type range of your column
set coloumn count = 2
change the widht of colomn
You can use the dropdown menu for the first column and the VLOOKUP function for the second column.
VLOOKUP would look at the first column and based on what's there would fill the second with the data from somewhere else.
I've also found a YouTube tutorial on how to use the function. Here you go:
https://www.youtube.com/watch?v=-WAEzokHSJM

excel find gap in dates

I have a range of dates in the following format
Hire TERM ReHire1 TERM2 ReHire2 TERM3 ReHire3 TERM4
The problem is that some rows might be missing a date, say a row will have dates in all but 'term' (B2). I can go in and use the filters to show blanks, but this becomes a nuisance when there are 15-20 date columns. Is there a formula that will look at the whole range and return an error of sort where there are empty cells?
Below is a comma delimited sample data that you can import into excel to help illustrate.
Hire,TERM,ReHire,TERM,ReHire,TERM,ReHire,TERM
05/06/2002,12/09/2002,,05/12/2003,02/10/2004,03/29/2005,,
05/30/2000,05/24/2004,09/27/2004,11/27/2004,,08/31/2006,05/24/2007,
03/15/2004,02/01/2005,02/16/2005,06/13/2005,02/06/2006,03/13/2006,10/14/2007,01/06/2008
03/13/1998,08/28/1998,,11/20/2000,11/03/2002,07/23/2009,09/08/2009,11/21/2009
07/12/2007,05/01/2009,07/12/2007,05/01/2009,07/28/2011,,07/28/2011,
12/20/2004,11/11/2005,02/23/2009,11/25/2009,08/10/2010,08/24/2010,,
08/23/2001,08/11/2002,,11/22/2006,01/15/2007,,,
Additional details per feedback:
A missing value -or "gap" as I call it- would be if a row has dates under hire and rehire but no date on Term.
You can either:
Split your data with Excel builtin solution and choose to split on commas ,
Select your data on Excel
Then click on "Data", "Text To Columns..."
Click on the "Delimited" radio button
Then click on the "Next" button, in "Delimeters" put a checkmark in "Comma"
Then click on the "Finish" button.
and then find the empty cells with a conditional formula
Use this kind of formula
=IF(ISERR(FIND(",,",A1)),"Missing value","")
to check if there is any missing value
One option would be to use conditional formatting on the cells. In Excel 2010, highlight the data range, pick "home->conditional formatting->highlight cell rules->more rules".
Then pick "format only cells that contain" and change the drop down with "Cell Value" to "Blanks" and click the "Format..." button and set how you want it highlighted (Fill color to yellow for example).
Alternativley, you could add a formulae "countblank" either over the the entire range or a subrange (row for example) and it will specify the number of blank cells. For example, you could in the final column add "=countblank(a2:h2)" and then filter the results for anything greater than 0. This would show you all the rows with missing data and you could correct them as needed.
I have imported your data into Excel 2011 on a mac.
If I understand your question, all you want to do is to find the empty cells. Then you just press CMD-F or CTRL-F on windows to start a search. You just leave the search field empty. Excel will then show you the empty fields one by one.

Resources