How would I create a bar chart by cell color in VBA

Macro_Nerd99

Board Regular
Joined
Nov 13, 2021
Messages
61
Office Version
  1. 365
1667251856475.png

How would I create a bar chart that calculates the difference between the end times and start times and adds them for each color in column C?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Add a column to the right of the Category: column called something like Time Used with a formula that subtracts Start Time: from End Time:. All of your dates are 10/31/2021, so you won't have to deal with the time "flipping" to the next day. Remember, the way the actual number of a date is the number of days since 1/1/1900, TIME is measured as a decimal part of 24 hours, so it would look like this
Book1
FGHI
28StartEndTimeFormatted (hh:mm)
2912:00 AM01:00 AM0.0416666701:00
3012:00 AM09:00 AM0.37509:00
3112:00 AM09:00 PM0.87521:00
3212:00 AM11:00 PM0.9583333323:00
Sheet1
Cell Formulas
RangeFormula
H29:H32H29=G29-F29
I29:I32I29=H29

Column H has no formatting (General) and the actual Decimal equivalent of the formatted time in column I.

And please use XL2BB. The link to the page with it's description and a download link are in my signature.
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,265
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top