Date Formula

fairchance

Board Regular
Joined
Jan 4, 2015
Messages
110
Dear Sir,

I am seeking data formula/function that could calculate the number of days from the expected date to actual date.
I can come up with formula to calculate the number of dates between real dates and expected dates. Here is the example parameters:

Range Definition:(days of month)
Beg 1-10
mid 11-20
End 21-30

<tbody>
</tbody>
Expacted date for submission Actual Date Formula
21-Dec-1421-Dec-140
21-Dec-1418-Dec-14-3
21-Dec-1427-Dec-146
Beg Dec 149-Dec-14 #VALUE!
End Dec 1418-Dec-14 #VALUE!
Mid Dec 1427-Dec-14 #VALUE!

<tbody>
</tbody>
How can i calculate date difference in case of date relate to particular range? Any one can help please.

Regards

Shehbaz

<tbody>
</tbody>
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Dear gaz_chops

You are a genius expert as you gave me half part of formula. Now i want to combine it into single cell based on all hypothesis i explain above.

Regards

Shehbaz
 
Upvote 0
You asked
I need a formula to calculate the salespersons pay rate:

Leads 1-5 are paid at $10 each
Leads 6-10 are paid at $15 each
Leads 11+ are paid at $20 each

For example, 7 qualified leads in a day are paid at (5x$10)+(2x$15)=$80, 13 qualified leads in a day are paid at (5x$10)+(5x$15)+(3x$20)=$185.

March
12345
JohnQualified45566
SallyQualified63554
BenQualified56455

<tbody>
</tbody>

The answer is:

John4050506565
Sally6530505040
Ben5065405050

<tbody>
</tbody>


What is the formula?

I replied.
 
Upvote 0
Thank you gaz_chop for reply of my previous post. Currently, i am stuck with my first post which is still important for me; the post i just publish regarding complex formula into single cell. I would be highly grateful to you if you would combine such formula in single cell.

Kind Regards

Shehbaz H.
 
Upvote 0
Dear Sir Gaz_chop

I have a clue from other source as is not working correctly:

=IF(ISNUMBER(A2),B2-A2,DAY(B2)-DAY(LOOKUP(LEFT(A2,3),{"Beg","End","Mid"},{0,11,21})))

It does not fulfill the following criteria:

If B4 within Expected date range then B4-A4=0

Regards

Shehbaz H.
 
Upvote 0
Test this
=IF(AND(LEFT(A2,3)="beg",DAY(B2)>10),B2-(10&RIGHT(A2,7)),IF(AND(LEFT(A2,3)="mid",OR(DAY(B2)<11,DAY(B2)>20)),B2-(20&RIGHT(A2,7)),IF(AND(LEFT(A2,3)="end",DAY(B2)<21),B2-(31&RIGHT(A2,7)),B2-A2)))
 
Upvote 0
Thank you so much sir, we are much near to the solutions. Currently the following are incorrects:

Beg Dec 149-Dec-14-10#VALUE!

<tbody>
</tbody>
Beg Jan 1522-Dec-14-190-19

<tbody>
</tbody>

The correct answer is 0 instead of #value! and 12 instead of -19

Kindly look into it

Thanks
 
Upvote 0
Thank you so much sir, we are much near to the solutions. Currently the following are incorrects:

Beg Dec 149-Dec-14-10#VALUE!

<tbody>
</tbody>
Beg Jan 1522-Dec-14-190-19

<tbody>
</tbody>

The correct answer is 0 instead of #value! and 12 instead of -19

Kindly look into it

Thanks
 
Upvote 0
Thank you so much sir, we are much near to the solutions. Currently the following are incorrect:Beg Dec 14 9-Dec-14 #VALUE!Beg Jan 15 22-Dec-14 -19 -19The correct answer is 0 instead of #value! and 12 instead of -19 Kindly look into itThanks
 
Upvote 0
Test
=IF(AND(LEFT(A2,3)="beg",DAY(B2)>10),B2-(10&RIGHT(A2,7)),IF(AND(LEFT(A2,3)="mid",OR(DAY(B2)<11,DAY(B2)>20)),B2-(20&RIGHT(A2,7)),IF(AND(LEFT(A2,3)="end",DAY(B2)<21),B2-(31&RIGHT(A2,7)),IF(LEFT(A2,3)="beg",B2-(10&RIGHT(A2,7)),IF(LEFT(A2,3)="mid",B2-(20&RIGHT(A2,7)),IF(LEFT(A2,3)="end",B2-(31&RIGHT(A2,7)),B2-A2))))))
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,047
Members
449,206
Latest member
Healthydogs

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