nested if statements

suzyt1374

New Member
Joined
Sep 1, 2017
Messages
3
I am trying to write a formula that will look at a date in column H2 and determine if that date is a prior week, week 1 or week 2

For example anything older than or equal to 8/19/17 is prior, any date between 8/20-8/26 is week 1, and any date between 8/27-9/2 is week 2.

I have it already done to isolate week 1 or week 2 but need to capture prior week. This is what I have to build off of, any help would be appreciated.

=IF(H2<=DATEVALUE("08/26/17"),"week 1","week 2")

there will be all different dates in column h2 ranging back a over a month or more in some cases.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
IF 8/27 - 9/2 is week 2 what about dates after 9/2?
 
Upvote 0
Try
Code:
=IF(H2<=DATEVALUE("8/19/17"),"pror week",IF(H2<=DATEVALUE("8/26/17"),"Week 1","Week 2"))
 
Upvote 0
I am trying to write a formula that will look at a date in column H2 and determine if that date is a prior week, week 1 or week 2
_ _ _

there will be all different dates in column h2 ranging back a over a month or more in some cases.


I'm guessing you have a working spreadsheet which you will update and use moving forward. Changing the date every time is going to be a pain. Try this one:

<today()-6-weekday(today(),1),"prior week",if(and(h2=""><today()-6-weekday(today(),1),"prior week",if(and(h2="">IF(H2<today()-6-weekday(today(),1),"prior week",if(and(h2="">=TODAY()-6-WEEKDAY(TODAY(),1),H2<=TODAY()-WEEKDAY(TODAY(),1)),"Week 1",IF(AND(H2>=TODAY()+1-WEEKDAY(TODAY(),1),H2<=TODAY()+7-WEEKDAY(TODAY(),1)),"Week 2")))

I noticed your week runs from Sunday to Saturday so worked it around that. It will look at today's date and determine the week. You would never need to update the formula.
</today()-6-weekday(today(),1),"prior></today()-6-weekday(today(),1),"prior></today()-6-weekday(today(),1),"prior>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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