VB Countif to count dates and paste results

BShady

New Member
Joined
Apr 26, 2010
Messages
2
Hi! I think this will be easy for someone smarter than me.
The data: I have a list of items in for repair, and record the date the item hits a particular department in a spreadsheet. Departments are columns, Items in for repair are rows.
What I've done: Created a sheet with a row for each day of the year, and a column for each department, and countif in each cell using the date in column A as criteria to determine how many repairs on a given day are in a given department.
The problem: I lose historical data because as a unit moves from dept to dept, the cell formulas causes a subtraction on one date and addition on another.

The solution (I think!) Use VB to do the counting and paste the count into a corresponding cell.
  • Using today as the date (or ask?) and set it as target-date
  • For every row in each of 12 columns (depts) count target-dates recorded there
  • Paste count into new (or target-date corresponding) row and corresponding dept column of a sheet named "Report counts"
The reward? Extreme gratitude from someone who only wishes he had the time and ability to figure it out on his own!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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