working with dates

mort1703

Active Member
Joined
Sep 13, 2008
Messages
266
Hi

I am working on a problem whereby I have the following columns

A1 - a frequency of MON-SUN
B2 - a date ie 02/06/2015

C1 - needs to contain the date based on A1

IE.

A1 B1 C1
FRI 02/06/2015 NEED TO RETURN 29/05/2015
THU 02/06/2015 NEED TO RETURN 28/05/2015

can anyone help?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,

Try this:

=B1-IF(A1="Mon",0,IF(A1="Tue",1,IF(A1="Wed",2,IF(A1="Thu",3,IF(A1="Fri",4,IF(A1="Sat",5,6))))))
 
Last edited:
Upvote 0
Hi,

Or better still, try this one.

=B1-IF(A1="Mon",8,IF(A1="Tue",7,IF(A1="Wed",6,IF(A1="Thu",5,IF(A1="Fri",4,IF(A1="Sat",3,2))))))

Thursday came after Friday in your list and I am easily confused :)
 
Upvote 0
Are you trying to get the date of the previous week? In your example, what if
MON 02/06/2015

do you want to return 01/06/2015 (previous Monday), or 26/5/2015 (Monday of previous week)?



Hi

I am working on a problem whereby I have the following columns

A1 - a frequency of MON-SUN
B2 - a date ie 02/06/2015

C1 - needs to contain the date based on A1

IE.

A1 B1 C1
FRI 02/06/2015 NEED TO RETURN 29/05/2015
THU 02/06/2015 NEED TO RETURN 28/05/2015

can anyone help?
 
Upvote 0

Forum statistics

Threads
1,203,187
Messages
6,053,992
Members
444,696
Latest member
VASUCH

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