Calculating Period by if funtcion

gam2086

New Member
Joined
Jan 21, 2015
Messages
29
I have a table below for period.

Sheet 1

Start DateEnd DatePeriod
2/4/20183/3/2018Period 1
3/4/20183/31/2018Period 2

<tbody>
</tbody>

Sheet 2

Has Hire date column C2 (2/15/18).

I am looking for help to whether I can use if formula to say 2/15/18 fall in Period 1, whereas if is 3/15/18 fall in period 2 and so on.

Please help. Looking for a solution as soon as possible.

thank you in advance
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Excel 2010
ABC
1StartEmdPeriod
24-Feb-183-Mar-18Period 1
34-Mar-1831-Mar-18Period 2
4
5
6
7Hire Date
815-Feb-18Period 1
9
Sheet 1
Cell Formulas
RangeFormula
B8=VLOOKUP(A8,'Sheet 1'!A2:C3,3.1)


=IF(AND(A8>='Sheet 1'!A2,A8<='Sheet 1'!B2),"Period 1",IF(AND(A8>='Sheet 1'!A3,A8<='Sheet 1'!B3),"Period 2",""))
 
Last edited:
Upvote 0
Hello Dave,

It is not working if =VLOOKUP(A8,'Sheet 1'!A2: C3,3.1).
Is this 3.1 or it column index 3 and True.
I thought lookup will look up for certain value only. It will not look up between those dates.
Not sure. Please let me know

Thank you for reply
 
Upvote 0
Does this do what you want?

The ROW($1:$100) is arbitrary. It makes room for a future range of 100 periods. If fewer are needed change the $100.


A
B
C
D
E
1
Periods start →​
2/4/2018​
Hire Date​
Hire Periods​
2
2/15/2018​
1​
In D2: =MATCH(C2,EDATE($B$1,INDEX(ROW($1:$100)-1,0)),1)​
3
3/15/2018​
2​
 
Upvote 0

Excel 2010
ABC
1StartEndPeriod
24-Feb-183-Mar-18Period 1
34-Mar-1831-Mar-18Period 2
4
5
6
7Hire Date
815-Feb-18Period 1Period 1
9
Sheet 1
Cell Formulas
RangeFormula
B8=VLOOKUP(A8,'Sheet 1'!A2:C3,3,1)
C8=IF(AND(A8>='Sheet 1'!A2,A8<='Sheet 1'!B2),"Period 1",IF(AND(A8>='Sheet 1'!A3,A8<='Sheet 1'!B3),"Period 2",""))


The formula had a "." instead of a ",".

I also included a space in the Sheet name per your example.
 
Last edited:
Upvote 0
Thanks for the feedback.

I had cataract surgery and correction; hope some day to be able to see better.
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,694
Members
449,117
Latest member
Aaagu

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