Data Bar calculated from another cell (Conditional Formatting) - excel

In Excel 2016, I've been using conditional formatting's 'Data Bars' to make progress bars in a task register. I don't enough reputation to post an image, but imagine a table like this with data bars in the right column:
+---------+----------+
| Project | Progress |
+---------+----------+
| Task 1 | 40% |
| Task 2 | 20% |
| Task 3 | 100% |
| Task 4 | 80% |
+---------+----------+
Would it be possible to have the data bar display in the Project column instead?

Unfortunately, data bars need to get their data from the cell in which they exist.
However, a couple workarounds/alternate methods:
You could overlay a bar chart, removing all the backgrounds, borders, axes and gridlines, and setting the bar colour to be 60%+ transparent.
(Source)
You could use conditional formatting to display a solid color or gradient fill in the alternate cells.

Related

grouped and alternating conditional formatting

I have 3 sites, each of them have worked some tickets that I am reviewing. I would like to alternate between 2 shades of one color for each group: Site 1 would alternate between a lighter and a darker green, Site 2 would alternate between two shades of red, and Site 3 the same with Blue. However, I do not want to alternate every row, but rather every other ticket. The tickets may have a variable number of rows that are grouped with it. See screenshot where i have manually applied an example of the formatting im going for (these are not the final colors, these are used because the originals werent viewable after the image was uploaded).
Here is an image with the sample formatting:
Im fairly certain a helper column will be required here and while i'm fairly decent with excel and conditional formatting this one is a bit beyond me.
I will only use the Site column and Ticket column from your example to demonstrate my solution. Suppose the Site column is in Column A and Ticket column is in Column B, I will use Column C as the helper column in the following way presume the first row is for headers that do not need to be formatted:
In cell C2 enter number 1, this value is hard-coded/static;
In cell C3 enter the following formula and drag it down to the end of your table:
=MOD(IF(LEN($B3)=0,$C2,IF($B3=$B2,$C2,$C2+1)),2)
Then you should have a helper column showing either 1 or 0 based on the ticket number.
Highlight your table with cell A1 (i.e. the first cell of the range excluding header) being the active cell, set up the following conditional formatting rules one by one:
| Conditional Formatting Rules: | Format |
|-------------------------------|-------------|
| =(MAX($A$2:$A2)*10+$C2)=11 | Light Green |
| =(MAX($A$2:$A2)*10+$C2)=10 | Dark Green |
| =(MAX($A$2:$A2)*10+$C2)=21 | Light Red |
| =(MAX($A$2:$A2)*10+$C2)=20 | Dard Red |
| =(MAX($A$2:$A2)*10+$C2)=31 | Light Blue |
| =(MAX($A$2:$A2)*10+$C2)=30 | Dark Blue |
Then you should have the following:
Please note Column D Rule is for demonstration only which is not necessary in the actual table. It shows you how my formulas have differentiated each row based on Site and Ticket.
EDIT #2
Given that the Site ID are actually texts rather than numbers, here is an alternative approach, which is still using the helper column as illustrated in the original solution, but the conditional formatting rules will be changed to:
| Conditional Formatting Rules: | Format |
|---------------------------------------------------------------------------------------------|-------------|
| =(INDEX($A$2:$A2,AGGREGATE(14,7,ROW($A$1:$A1)/ISTEXT($A$2:$A2),1))&"#"&$C2)="Site Name 1#1" | Light Green |
| =(INDEX($A$2:$A2,AGGREGATE(14,7,ROW($A$1:$A1)/ISTEXT($A$2:$A2),1))&"#"&$C2)="Site Name 1#0" | Dark Green |
| =(INDEX($A$2:$A2,AGGREGATE(14,7,ROW($A$1:$A1)/ISTEXT($A$2:$A2),1))&"#"&$C2)="Site Name 2#1" | Light Red |
| =(INDEX($A$2:$A2,AGGREGATE(14,7,ROW($A$1:$A1)/ISTEXT($A$2:$A2),1))&"#"&$C2)="Site Name 2#0" | Dard Red |
| =(INDEX($A$2:$A2,AGGREGATE(14,7,ROW($A$1:$A1)/ISTEXT($A$2:$A2),1))&"#"&$C2)="Site Name 3#1" | Light Blue |
| =(INDEX($A$2:$A2,AGGREGATE(14,7,ROW($A$1:$A1)/ISTEXT($A$2:$A2),1))&"#"&$C2)="Site Name 3#0" | Dark Blue |
Here is the screen-shot:
Let me know if you have any questions. Cheers :)

how to hide details in excel row to only show the main information and to be able to show it only on click

I'm new to excel, could anyone help?
My data:
id | product | single cost | sum of costs
------------------------------------------------
project1 | a | 1 | 3
------------------------------------------------
| b | 2 |
------------------------------------------------
project2 | a | 1 | 12
------------------------------------------------
| b | 2 |
------------------------------------------------
| c | 3 |
How to hide the column "single cost"... but show it when clicking "sum of costs"?
I'm not certain if you want to hide the row/column entirely or if you want to hide the row/column but allow the user to unhide it easily by clicking. Hiding a row or column in Excel is straightforward -- highlight the row(s)/column(s) you would like to hide, then click on "Format" in the cells portion of the "Home" tab and go to "Hide & Unhide."
If you want the rows or column to be hidden but easily expanded open, you can use Excel's "Group" functionality. Highlight the row(s)/column(s) you would like to hide, then go to the "Data" tab. In the "Outline" area, select "Group." This will add a plus/minus sign either above the column or beside the row -- clicking the minus will hide the rows/columns, clicking the plus when they're hidden will make them visible again.
Does this solve your issue?

In Excel, how do I chart multiple series when the series is in the first column

I have an excel spreadsheet with three columns (component, data, count) where I'd like to chart (line chart, stacked area, etc...) that data such that the component column is the series, and the date and count columns are the X, Y values (like a date and a count).
|component| date |count|
| A | 2017-01-01 | 10 |
| B | 2017-01-01 | 12 |
| A | 2017-03-01 | 15 |
| B | 2017-03-01 | 10 |
I know that I can re-arrange the data so that the component and the date are across the top/side and the values in the middle and that charts pretty naturally, but I keep getting data in this "first column is the series" and it would be great to be able to chart that without a big data conversion process.
| |2017-01-01|2017-03-01|
| A | 10 | 15 |
| B | 12 | 10 |
Basically I'm looking for the method to chart data provided like the top table as if it were formatted like the bottom table without having to manipulate the data (particularly when there is a lot of data to manipulate).
Your data is in good database format, so this is the perfect time to use a PivotChart:
Select your data
Go to the Insert tab of the ribbon, click on the Dropdown arrow on PivotTable button and choose PivotChart
On the field list on the right, drag Component to Legend (Series)
Then drag Date to Axis Fields (Categories)
Then drag Count to Values
You'll get a bar chart by default. Click on the background of the chart to select the entire chart. Then on the PivotChart Tools Ribbon, go to the Design Tab, click Change Chart Type and choose Line.

Convert Excel Raster into Shapefile

I have an excel table in which each cell represents (NOT CONTAINS) a coordinate-pair and a value. For example Sheet 1:Cell A1 contains an X-coordinate which increases 25m downwards; Sheet 2: Cell A1 contains a Y-Coordinate which increases along; and Sheet 3: Cell A1 contains a value. Thus in effect, this is a Raster file made up of 3 Excel data sheets with a resolution of 25m with Sheet 1 representing the X-Axis, Sheet 2 the Y-Axis and sheet 3 a value within the cell.
Table structure excerpt - 200 Columns / 2000 Rows
Table "XCoord"
3544399.00 | 3544399.25 | 3544399.50 | 3544399.75 | 3544340.00 | ...etc
3544231.00 | 3544231.25 | 3544231.50 | 3544231.75 | 3544232.00 | ...etc
3544135.00 | 3544135.25 | 3544135.50 | 3544135.75 | 3544136.00 | ...etc
Table "YCoord"
584449.00 | 584449.25 | 584449.50 | 584449.75 | 584449.00 | ...etc
584431.00 | 5844431.25 | 584431.50 | 584431.75 | 584431.00 | ...etc
584429.00 | 584429.25 | 584429.50 | 584429.75 | 584429.00 | ...etc
Table "Concentration"
0.0023 | 0.0025 | 0.0020 | 0.0027 | 0.0066 | ...etc
0.0011 | 0.0034 | 0.0056 | 0.0078 | 0.0033 | ...etc
0.0016 | 0.0026 | 0.0046 | 0.0003 | 0.0005 | ...etc
So you see, for the cells - the xcoord the ycoord and the concentration can be determined.
This is a raster built with 3 tables. My problem is how to map this into a GIS application. The values in the Table "concentration" are derivitives calculated out of other tables which include the plume-dispersion parameters. So in effect, this worksheet is a very ingenious way of calculating plumes without using expensive plume modelling software. I am using ArcGIS Advanced (Info), Safe fme, Excel.
I have to convert this into a raster image or point feature class. Does anyone know how I could translate this data out of excel?
Thanks for any tips,
RB
I'm not sure what you've tried so far and what other technology's available to you, but there are many examples on the internet of using Excel + VBA to generate shapefiles, or using other programming languages like Python.
You may want to take a look at the Geographic Information Systems Stack Exchange site - there are some good examples there of how to interface between Excel and common GIS tools, for example, "How can I convert an Excel file with X and Y columns to a shapefile". The basic info is there, you'll just need to adjust your specific code to work for having data across sheets instead of down rows.
If you wanted to convert your sheets data to a single sheet with x, y, data columns, you could write a VBA script to loop over each cell in the first sheet and extract the data from the same address on the other sheets.
To get a more specific answer, you'll need to post a more specific question regarding what method you're trying to do, and what part you need help on.

Isolate Rows that Contain Certain Values in One Column (Excel)

I need help with what I think is a simple Excel formula or function. I have two columns. As an easy example let's say the first column is numbers and the second column is colors:
| 1 | Red |
| 2 | Blue |
| 3 | Red |
| 4 | Red |
| 5 | Green|
| 6 | Brown|
Let's say I just wanted the rows with red in the second column and have everything else on the sheet deleted. How would I do that? To be clear, I want the values in column one to remain as well. This is how I would like it to look:
| 1 | Red |
| 3 | Red |
| 4 | Red |
It seems like it should be simple but I can't seem to find any way to do that. There are similar question on the forum but they are more complex than what I'm asking and require super long formulas. If that's what is required, I suppose that's what I'll do but just wanted to see if there was an easy way to do it as well. Thanks for the help!
You can use autofilter to filter the second column. Then select and copy the visible cells only, remove the filter, delete everything and paste what's in the clipboard.
Or do you need a dynamic solution? Then you could build a pivot table on a separate sheet. Put the desired color in the page filter and refresh the pivot table when the source data has changed.

Resources