How set bar color based on specific multiple weekday value - excel-2007

I have an excel sheet with data.
column A have date and column B have some value, both make a bar chart with same bar color.
I want to convert all date to weekday and make a separate bar color according to my desired weekday.
Example: i want to make separate bar color if bar belongs to sunday,tuesday,friday.
How can i achieve this??
this is my excel sheet (Sheet1)

Thanks i sort out my problem through vba side. Still hope for better opinion.

Related

Color a specific range of cells in the same row

Similar to a Gantt Chart but not quite the same, I'm trying to color a variable range of cells on the same row.
As you can see I have a variable number of tasks and a variable start and end for each task
I've created a simple time series where the "Machine 1", which is in the row number 6, is making all the tasks. The time series is in the row number 3.
So basically, I need to color the ranges given by the tasks table in the Machine 1 row, using that time series as a reference to start coloring the cells. Each task has to have a different color.
As I'm a beginner in VBA, I've been trying to do this using a formula:
=IF(AND($C4<=AK$3;$D4>=AK$3);1;0)
Being C4 the start of the task, AK3 the place of the time series right now, and D4 the end of the task. Then I would fill the whole Machine 1 row. This would give a 1 in the range of the task and a 0 before and after the task, then I could format the row and color the cell by the given value in each cell. (1 color and 0 blank)
The problem is that this only works for one task and I really don't know how to change the formula to add the other tasks. I'm pretty sure this can be done in VBA but, like I said, I'm still a beginner. Please help me
The final answer should look like this. The color doesn't matter, it's how to color the variable ranges automatically the problem
If I understand what you want correctly, this can be done with conditional formatting:
Use four conditions, one for each of the following formulas:
=COLUMN(AK6)<=$D$7+37
=COLUMN(AK6)<=$D$6+37
=COLUMN(AK6)<=$D$5+37
=COLUMN(AK6)<=$D$4+37
and apply them in that order to $AK$6:$BZ$6

How to color a cell based on values and date difference in another cell using VBA

Consider I have a Table A in Excel - details as below:
And another Table B as follows
I want out-put as follows,
The Name from Table B has to be checked with Name in Table A, and respective StartDate and EndDate should be picked from Table A and same should be compared with dates in Table B and cell under that name should be colored to green if Status in Table A is in "In Progress" or to Red if in "On hold"
For Example:
Consider Jack in Table B, it has 3 records in Table A, The first start date should be picked i.e 4-Apr-2017 and End date as 27-Apr-2017, and respective coloring has to be done based on status field.
How can I achieve this using VBA/anything in Excel. I'm new to VBA.
Yes you can do it in VBA but I would recommend using conditional formatting (formula) as it doesn't require programming knowledge. To do this, you will need to employ the Vlookup formula.
I believe the output you want is something in the picture link here?
To make conditional formatting, look in the "Home" tab, under Styles -> Conditional Formatting. Highlight the cell you want to format, then select Conditional Formatting -> New Rule. This will cause a new window to pop up. Select "Use a formula to determine which cells to format".
You would want 2 conditional formats.
1.To show green if the date is within the start and end date. To do so, select the first cell in the Gantt chart (cell B8 in example) then enter formula below.
=IF(AND(B$7>=VLOOKUP($A8,$A$2:$D$5,3,FALSE()),B$7<=VLOOKUP($A8,$A$2:$D$5,4,FALSE())),TRUE(),FALSE())
2.To show red when user has item beyond due date, enter formula below with same cell highlighted.
=IF(B$7>VLOOKUP($A8,$A$2:$D$5,4,FALSE()),TRUE(),FALSE())
Once that is done, you can apply the format painter or copy and paste the cell with conditional formatting to extend your table/Gantt chart.
Note that the $ signs are important as they lock the relative reference positions in the formulas. Using the second formula as an example, B$7 refers to the date and you need the reference to be locked to row 7, where all the dates are. On the other hand, the column reference (Column B) can be shifted as you want it to change to with the columns to properly compare against the other dates.
As for multiple items per user, can you expand upon your initial question? Would you like to track based on per user or per item? I am assuming that you're creating a Gantt chart to track a project. In that case, it would make more sense to track specific tasks assigned to people. You can modify the example given to track based on task.

Color a row based on condition in Interactive report in Oracle Apex 5

I wanted to color the complete row based on some criteria. My query looks like this:
select QUIZ_ID,
QUIZ_NAME,
QUIZ_TOTAL_SCORE,
QUIZ_MINIMUM_SCORE,
START_DATE,
END_DATE,
ACTIVE_FLAG
from QUIZ;
When the ACTIVE_FLAG value = 'Y' then I want the row to be colored. I have used a technique which I found somewhere but it is not what I am looking for. It has colored the text not complete cell (shown below). But I want complete cell to be colored.
If you are using an Interactive Report instead of classic report, you have that ability via the "Actions" button/menu, "Format" option, "Highlight" option, where you can enter your criteria and what colors you want for foreground (text), and background, and whether to highlight the cell or whole row.

Vertical line showing current week in timeline

Ok so I recently added a vertical line showing the current week in a chart using this method: http://www.officetooltips.com/excel/tips/how_to_add_a_vertical_line_to_the_chart.html
but now I want to add one to a sheet without a chart. Is this possible?
So my timeline looks like this:
Is vba needed or is this possible with formulas I really have no idea.
You can make it auto update every week using NOW() formula:
What you have to make sure is that each column is formatted based on the cell in row A (or any other row/column) so you format all cells based on the dates in the first row. To look from each cell to the second row you use OFFSET($A$1,1,COLUMN()-1) and get the relevant date for this column. This could be done for any other cell that holds the relevant date for the column, but there must be one like this. The condition in the figure is one for all the table.
EDIT:
To match the format of YYMM for the date, use the formula (assuming $D$2 is the upper left cell of the table):
=OFFSET($D$1,1,COLUMN()-COLUMN($D$1))=RIGHT(YEAR(NOW()),2)*100+WEEKNUM(NOW())
for the current week, or replace the NOW() in it with a cell with the date of interest.
Hope it solves your problem ;)

transposing a named range in a VBA range object

I have a named range "CompletedSheetYears" which is a one column table in my DataTables sheet. The years are sorted vertically in chronological order from top to bottom, newest year at top.
This causes a problem in my charts as when I grab the range of years to use in the range of dates for the chart, it plots backwards. Yes, I know I can transpose the axis in the chart but that moves not only the dates to the right order but it moves the scale to the right of the chart which I don't want.
I know I can loop in reverse to create the right range but there must be a simpler way to do it, my VBA is rusty not having used it for some time now.
Is there a simpler way? i.e.
Set rangeReverseDates = Range("CompletedSheetYears").Transpose
or something to that effect. (Obviously, there is no Transpose method for range, or none intellisense showed me)
Something like this
Range("d1").Resize(1, Range("TTT").Cells.Count) = WorksheetFunction.Transpose(Range("TTT"))