Count if and sum if working days and working hours macro

tuytuy

Board Regular
Joined
Mar 28, 2013
Messages
75
Hi,
MonthGSM numberExtensionGroup nameSubgroup nameName GSM numberUser ref1User Ref2Call dateCall timeCall durationDestinationZone/Country/OperatorTariffTypeSupplementary servicesIndicative tariffUsage amount
Jan-130470/132056Unfiled - Niet toegekend - Non attribué19-Dec-1210:51:5100:00:4231624298877Vodafone P-BNormalOutgoing roaming callsR00.203
Jan-130470/132056Unfiled - Niet toegekend - Non attribué29-Dec-1213:10:4500:00:4531624298877Vodafone P-BRéduitOutgoing roaming callsR00.2175
Jan-130470/132056Unfiled - Niet toegekend - Non attribué29-Dec-1214:16:3600:16:1531651275403Vodafone P-BRéduitOutgoing roaming callsR04.7122
Jan-130470/132056Unfiled - Niet toegekend - Non attribué29-Dec-1213:27:0700:00:3031651275403Vodafone P-BRéduitOutgoing roaming callsR00.145

<colgroup><col><col><col><col span="2"><col><col span="2"><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
i have a table like above,
i need, using a macro, to count and then sum the total amount used for all non working days and calls outside working hours (7.00 am to 7.00 pm / 0700 to 1900)
using an excel formula i was thinking of using the D formula on the date and then count only the ones that have a value equal to 6 or 7.
But i'm quite new to vba and i have no idea how to right a vb code to solve this.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
i just want to count the number of communication during the weekend and outside working hours.
each record on the table is one communication.
 
Upvote 0
I have now got a working spreadsheet PM me with your email address and I will send it.
 
Upvote 0
hmm that's not quit what i was looking for.
I was trying to create a MACRO so a vba code to count the number of call outside the working hours and the weekend. So basically i just need a code that will output only a number.
And then i would need a separate one that would calculate the amount used for these calls.
In the files you've send me, there is no vba code but just excel functions
 
Upvote 0
ok - but if the number of calls pre 0700 and post 1900 and at weekend is all you need ( and corresponding amount used) then I can make those 2 tables less detailed. Why do you need a macro?

A modified table will break down the calls by day or week or month whatever you want.
 
Upvote 0
because it will be part of a way longer macro, i need to do this in a new file every week, so using a vba code makes it way easier to do.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,039
Members
448,940
Latest member
mdusw

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