Need help creating a formula, or at least lead me towards the right way

Braco

New Member
Joined
Jun 14, 2017
Messages
2
Hi,
I need help in regards to making the below work, or is it even possible? Just head me towards the right direction and I will appreciate it. Would I use If/then for the below I am trying to do?

So I need to have a formula in the Category Column that can do the below based on the Start Date/Call Time/ Call Duration. There are usually over 100 calls, the below is jut a sample.

So the formula should first take the time it calculates for Mandatory, and then randomly select a few other calls from the list and mark them as Monitored and it should all equal around 1 hour ~.
Mandatory - Any call done on a weekend (start date), and any call before 8:00:00AM and any call after 6:00:00PM on a weekday.
Monitored - Are going to be random remaining calls that add up to 1 hour total.
Excluded - Everything else that remains blank.


Start date

<tbody>
</tbody><colgroup><col></colgroup>
Call Time

<tbody>
</tbody><colgroup><col></colgroup>
Duration

<tbody>
</tbody><colgroup><col></colgroup>
Call Duration

<tbody>
</tbody><colgroup><col></colgroup>
Category (Excluded, Mandatory, Monitored)

<tbody>
</tbody><colgroup><col></colgroup>
6/2/17

<tbody>
</tbody><colgroup><col></colgroup>
8:37:47 AM

<tbody>
</tbody><colgroup><col></colgroup>
58

<tbody>
</tbody><colgroup><col></colgroup>
0:00:58

<tbody>
</tbody><colgroup><col></colgroup>
6/3/17

<tbody>
</tbody><colgroup><col></colgroup>
8:40:34 AM

<tbody>
</tbody><colgroup><col></colgroup>
4

<tbody>
</tbody><colgroup><col></colgroup>
0:00:04

<tbody>
</tbody><colgroup><col></colgroup>
6/4/17

<tbody>
</tbody><colgroup><col></colgroup>
12:26:26 PM

<tbody>
</tbody><colgroup><col></colgroup>
14

<tbody>
</tbody><colgroup><col></colgroup>
0:00:14

<tbody>
</tbody><colgroup><col></colgroup>
6/5/17

<tbody>
</tbody><colgroup><col></colgroup>
8:57:57 AM

<tbody>
</tbody><colgroup><col></colgroup>
26

<tbody>
</tbody><colgroup><col></colgroup>
0:00:26

<tbody>
</tbody><colgroup><col></colgroup>

<tbody>
</tbody>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I've extended the data for testing


Excel 2012
ABCDEFGHIJ
1Start dateCall TimeDurationCall DurationCategory (Excluded, Mandatory, Monitored)3
206/02/20177:37:47 AM5800:00:58MandatoryM 118
306/03/20178:40:34 AM400:00:040.350658622341
406/04/201712:26:26 PM1400:00:14Monitored0.673426331455
506/05/20178:57:57 AM2600:00:26MandatoryM41166
606/06/20179:00:00 AM18Monitored0.934719151076
706/07/201711:00:00 PM16MandatoryM6480
806/08/20174:00:00 AM17MandatoryM71595
906/09/20171:00:00 PM100.43766858#N/A#N/A
1006/10/201712:00:00 PM23Monitored0.92300729#N/A#N/A
1106/11/20172:00:00 AM13MandatoryM10#N/A#N/A
1206/12/20174:00:00 AM12MandatoryM11#N/A#N/A
1306/01/20183:00:00 AM11MandatoryM12#N/A#N/A
1406/02/20188:00:00 AM150.133506713#N/A#N/A
1506/03/20189:00:00 AM110.614734414#N/A#N/A
Sheet2
Cell Formulas
RangeFormula
E2=IF(ISNUMBER(G2),IF(G2<=$J$1,"Monitored",""),"Mandatory")
F2=IF(OR(WEEKDAY(A2,2)>5,OR(B2<8/24,B2>18/24)),"M",RAND())
G2=IFERROR(RANK(F2,$F$2:$F$15),"")
H2=ROW(F2)-ROW($F$1)
I2=INDEX($C$2:$C$15,MATCH(H2,$G$2:$G$15,0))
J1=LOOKUP(60,J2:J15,H2:H15)


Cols F to G are the working part of the table.

1) Col F - work out the Mandatory and marked with "M", and create a random no for the rest
2) Col G - rank the cells with a random no, i.e. not Mandatory.
3) Col H - nos create for Col I
4) Col I - read out the duration (Col C) for the non Mandatory cells
5) Col J - accumulate the duration for Col I
6) Cell J1 - work out no of calls add up to 60 mins.
7) Col E - results
 
Upvote 0

Forum statistics

Threads
1,214,825
Messages
6,121,788
Members
449,049
Latest member
greyangel23

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