Excel/Need Formula

Advertisement


Question
Hi,

I do a weekly report for each of the weeks in each month. At the end of a month.

Cell C6 contains the week ending date, which is on Saturday, until the end of the month when it could fall on any day.

Cells F9 to L9 have the day headers
Sun Mon Tue Wed Thur Fri Sat

Cells F10 to L10 is where I manually key in the date.
Since the report is month specific, I only key in dates that are in the weeks of the month that I am currently reporting on. Cells in F10 to L10 that have no date I put --- and cells that have dates I put mm/dd/yr.

What I hope to accomplish is that once I put my week ending date in Cell C6, Cells F10 to L10 will automatically populate with the appropriate dates or --- if there is no date.

Example for week ending Saturday February 2, 2013

C6
Saturday February 2, 2013

F9   G9   H9   I9   J9     K9        L9
SUN  MON  TUE  WED  THUR   FRI       SAT
---  ---  ---  ---  ---    2/1/2013  2/2/2013

Thank you for your consideration.
Kindest regards,

Bob

Answer
Bob,

In cell F10, put in this formula:

=IF($C$6="","",IF($C$6=DATE(YEAR($C$6),MONTH($C$6)+1,0),IF(COLUMN()-5<=WEEKDAY($C$6),$C$6-(WEEKDAY($C$6)-(COLUMN()-5)),"---"),IF(MONTH($C$6-(12-COLUMN()))=MONTH($C$6),$C$6-(12-COLUMN()),"---")))

then select F10 and drag fill to the right to cell L10.

this will do what you describe

I am assuming the cell C6 will contain either a Saturday date or the date of the last day of the month.

--
Regards,
Tom Ogilvy
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Tom Ogilvy

Expertise

Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]

Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 About.com. All rights reserved.