Time and Date Formula Giving Strange Result

EfficientOne

New Member
Joined
Jun 10, 2010
Messages
12
Hello,
I have researched archived threads, the web, and Excel help and I'm tired and confused.:biggrin:

Columns -
1: Open Date & Time (format mm/dd/yyyy hh:mm)
2: Last Edited/Time State Changed (format mm/dd/yyyy hh:mm)
3: Days Since Ticket Last Changed =DATEDIF(P2,TODAY(),"d")
4: Weeks Since Ticket Last Changed =INT(S2/7)

Columns 3 & 4 have been formatted in General, Number, and Text.

The problem arises when Column 2 is blank.

1: 11/02/2011 10:27
2: Blank
3: 40919
4: 5845

What do I need to do and in which column to ensure it gives me something other than these numbers?

The results of all of the data is placed in a pivot table grouped by 4 week intervals and it looks very strange to have weeks 5844-5847.

Thanks for your help.

P.S. I found the formulas for 3 and 4 on an archived forum so for people like me who don't ask for help until they absolutely have to, thank you to all of you whom impart your knowledge.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hello,
I have researched archived threads, the web, and Excel help and I'm tired and confused.:biggrin:

Columns -
1: Open Date & Time (format mm/dd/yyyy hh:mm)
2: Last Edited/Time State Changed (format mm/dd/yyyy hh:mm)
3: Days Since Ticket Last Changed =DATEDIF(P2,TODAY(),"d")
4: Weeks Since Ticket Last Changed =INT(S2/7)

Columns 3 & 4 have been formatted in General, Number, and Text.

The problem arises when Column 2 is blank.

1: 11/02/2011 10:27
2: Blank
3: 40919
4: 5845

What do I need to do and in which column to ensure it gives me something other than these numbers?

The results of all of the data is placed in a pivot table grouped by 4 week intervals and it looks very strange to have weeks 5844-5847.

Thanks for your help.

P.S. I found the formulas for 3 and 4 on an archived forum so for people like me who don't ask for help until they absolutely have to, thank you to all of you whom impart your knowledge.
I forgot to add that I am using Excel 2007

The results that I am looking for is something like 'No Information' or blank. That way the pivot table would make a little more sense to the executives and managers reviewing the pivot graph and pivot table. 5845 makes it appear it hasn't been looked at in 112 years! (5845/52)
 
Upvote 0
If P2 is blank then Excel treats the date as 1/1/1900 and so the result you get is the days since then. You can check whether P2 is blank, i.e.

=IF(P2="","",DATEDIF(P2,TODAY(),"d"))

and for weeks

=IF(S2="","",INT(S2/7))
 
Upvote 0
Now that the data is correct, I am given weeks 0 - 94 and of course, the blank. When I refreshed the pivot table it did update, but it will now not allow me to regroup by four. When I highlight the Weeks Since Ticket Last Changed in the pivot report and Group it only gives me 1 group whether I sort A to Z or vice versa.
 
Upvote 0
hi
i have question? ow arrange hours in excel but not like army settings but like 06:10 am and then come 7:25 am and then 1:05 pm i hope that i will find some one to help me thank you very much
 
Upvote 0
1. Click on the Column Header to highlight the entire column.
2. Right click and select 'Format Cells'.
3. Under Category select 'Time'.
4. Select the third option or whichever one best fits what you want your dates to look like.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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