# Thread: Generating a macro or a formula to Count different date of services

1. ## Generating a macro or a formula to Count different date of services

Good Day to all
Long time ago I place a question regard a problem, and probably formulate the wrong question, that I have and can’t find a solution.

Need to identify and count the number of MRI Procedures complete in the day that were ordered; having the 7 PM of the day as the limit time to justify a next day procedure. In other word, I want to know how many MRI procedures ordered today - before 7 pm - are not done today but tomorrow in order to justify more employee past 7 pm…

The data I can query from the data base is attached with explanations in a excel file, and I can manually identify what studies ordered today before 7 pm were complete (done) he next day, but with more than 600 cases daily is a time consuming process. Therefore what I’m looking is a macro or formula that help me to do this task.

I was trying to use the formula suggested by other excel expert but could make it work : HERE

I appreciate any help. This will save a lot of time and probably will create another job to someone. Please considering by background is clinical not IS, therefore not an expert on formulas or macro.
Thanks
RAW DAT EXAMPLE: SAME DAY STUDIES .xlsx

sulbaran

2. You can do it with a formula

=IF(INT(B2)=INT(C2),"",IF(MOD(B2,1)<=--"7:00 PM","Not ","")&"justified")

The formula works very well. I can identify the "not justify" which later I can sort and count them.
sulbaran

4. If you just want to count the not justifieds, try

=SUMPRODUCT(--(INT(B2:B13)<>INT(C2:C13))*(MOD(B2:B13,1)<=--"7:00 PM"))

5. Bob,

That didn't work, just give me a number that I don't know what represent, see screenshot below :

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•