## use formula to calculate a number then if > 7 then divide by 7 to have a result in weeks

Hello,
I am comparing two dates and the result is the number of days apart, negative or positive.
My formula I am using is    =F12-\$E\$5.  What I need to know is if this result is greater than 7 days then divide by 7 so the result is in weeks vs days.  What do I need to do and what code is needed.  Also, the answer could be negative and would need to
still divide for the number of weeks.
Thanks
Mike

## Anwsers to the Problem use formula to calculate a number then if > 7 then divide by 7 to have a result in weeks

Code worked great.
Is there something I can add if it is diplaying weeks, like maybe a w after the number with a space before the w?
First off, I am going to ask you to mark Ashish Mathur's posting as the "Answer" also.
The reason is his formula is more easily modified to do what you are now asking for...
=IF(ABS(F12-\$E\$5)>7,(F12-\$E\$5)/7&" w",F12-\$E\$5&" d")
Now, in case all those decimal places are too many for your use, here is his formula modified to display only 3 decimal places for the "weeks" values...
=IF(ABS(F12-\$E\$5)>7,TEXT((F12-\$E\$5)/7,"0.000 \w"),F12-\$E\$5&" d")
where the number of zeroes after the decimal point (inside the TEXT function call) controls the number of decimal places being reported.
One thing you should be aware of with the output you just asked for...
the formulas return text values that, because
they are no longer numbers, cannot be used in any numerical calculations.
NOTE: Please mark the message or messages (yes, you can mark more than one) that answer your question as the "Answer" so that others will know your question has been resolved.

## Windows Error Reporting - To Fix use formula to calculate a number then if > 7 then divide by 7 to have a result in weeks

1. Go to Start button.
2. Open Control Panel.
3. Go to Windows Error Reporting.
4. Click on System and Maintenance, then click Problem Reports and Solutions.
5. Next, click Change Settings located on the left side panel of the Problem Reports and Solutions window.
6. Select an option to configure how you want Windows to look for a solution to your problems. You may allow Windows to do it automatically or ask you every time to check if problem occurs.
8. Select Off to turn off Error Reporting.

## Recommended Method to Fix the Problem: use formula to calculate a number then if > 7 then divide by 7 to have a result in weeks:

### How to Fix use formula to calculate a number then if > 7 then divide by 7 to have a result in weeks with SmartPCFixer? 2. After the scan is done, you can see the errors and problems need to be fixed. Click Fix All. 3. The Fixing part is finished, the speed of your computer will be much higher than before and the errors have been removed. 