Hello all. A slight macro adjustment should be possible I think to solve this pretty simple problem. Here is my data (there are four columns and ~5000 rows):
________________________________________________
Name.........Start Time.........End Time..........Duration
________________________________________________
..................8AM..................9AM..................1 hour
.................930 AM..............11AM..................1.5 hours
Lightbulb.....11AM..................12PM................1 hour
.................12PM....................1PM.................1 hour
..................1PM....................2PM..................1 hour
________________________________________________
..................8AM..................9AM..................1 hour
Fan.............9AM..................12PM.................3 hours
..................5PM..................530PM...............0.5 hours
_________________________________________________
etc. etc. etc.
The macro below is able to sum a variable number of the "duration" rows depending on when the "name" merged cell (i.e. "lightbulb") stops and ends. This issue is already solved; we are moving onto another problem now that I believe can use the same base code?
The syntax for that question is as follows:
=SUMMERGE(Target Range, Offset Column, Lookup Value)
Target range is the column of cells you wish to look within for the lookup value. This will be the column that has the merged cells. ----->
"Name" column
Offset Column is a number representing the column to Sum. A positive number means that many columns to the right of the Target column, while a negative number represents that many columns to the left. ------>
"3" in this case
Lookup Value is the value you are looking for.
------> i.e. "Lightbulb" or "Fan"
Notice how the end time of a certain row can sometimes be identical to the start time of the following row. Now I would like to count the number of instances that there are identical end&start times for each set of "name" cells (which are often - but sometimes not - merged cells). There would be 3 occurrences for "lightbulb" (11AM, 12PM & 1PM) and 1 for "fan" (9AM) in this example.
I cannot unmerge the "name" cell to make this easier unfortunately. As you can see, the number of rows each set of "names" contains varies - sometimes it is 5 rows, sometimes it is 3 rows, sometimes it isn't even a merged cell and is only 1 row. Can you help me out? I have almost zero macro experience. The macro above is working perfectly for the summing task and and might make this counting task an easy question to answer?
Thanks!
Bookmarks