Solved If and Then Statements with Dates in Excel

November 29, 2011 at 08:05:17
Specs: Windows 7
I have an excel document. How can I get excel to automatically populate several fields based on a date in another field. For example: If field A5 has a date of 02/01/2011..how do I have Excel automatically generate fields C6 thru C14 with dates of 2/1 thru 2/8? The fields in C6 thru C14 would change based on the date entered in C5.

Any help is greatly appreciated


See More: If and Then Statements with Dates in Excel

Report •


✔ Best Answer
November 29, 2011 at 12:05:15
In C6 enter this:

=A5

In C7, enter this and drag it down as far as you need:

=C6+1

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.



#1
November 29, 2011 at 10:07:59
First, let's get the terminology correct so that there is no confusion about what we are trying to do.

re: "field A5, fields C6 thru C14"

A5, C6, C14, etc. are cells not fields.

re: "The fields in C6 thru C14 would change..."

Do you mean the values in cells C6 thru C14 would change..."?

re: "generate fields C6 thru C14 with dates of 2/1 thru 2/8"

Something's missing here. The range C6:C14 contains 9 cells. 2/1 thru 2/8 is only 8 dates.

Please clarify what you are trying to do.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
November 29, 2011 at 10:20:38
I apologize for the terminolgy confusion. Yes, you are correct, I meant cells.

Yes, the values in cells c6 thru c14 would change when a different date is added in cell A5.

I was just trying to give an example...it should be 9 dates (2/1 thru 2/9)


Report •

#3
November 29, 2011 at 11:16:32
re: "I was just trying to give an example...it should be 9 dates (2/1 thru 2/9)"

Keep in mind that we can't see your spreadsheet from where we're sitting nor can we read minds. If your examples don't make sense to us when we read them, we have to get clarification so we don't waste time working on a solution that won't fit your needs.

re: "the values in cells c6 thru c14 would change when a different date is added in cell A5."

Once again, clarification is needed. The values in C6:C14 would change to what?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions

#4
November 29, 2011 at 11:34:13
If a date is entered in cell A5 (i.e. 02/01/2010); I need Excel to enter the following:

"2/1" in Cell c6
"2/2" in Cell c7
"2/3" in Cell c8
"2/4" in Cell c9
"2/5" in Cell c10
"2/6" in Cell c11
"2/7" in Cell c12
"2/8" in Cell c13
"2/9" in Cell c14.

If the date in A5 is changed to 04/12/2010, then C6:C14 should change to:

"4/12"
"4/13"
"4/14"
"4/15"
"4/16"
"4/17"
"4/18"..and so on.

Thanks.


Report •

#5
November 29, 2011 at 12:05:15
✔ Best Answer
In C6 enter this:

=A5

In C7, enter this and drag it down as far as you need:

=C6+1

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#6
November 29, 2011 at 12:56:04
Thank you.

Report •

#7
November 29, 2011 at 13:11:35
You see how easy it was once we understood exactly what you wanted to accomplish?

I kind of figured that that was what you wanted, but I've wasted a lot of time "assuming" the wrong requirements in the past, so I like to be sure that I know what the real goal is.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Ask Question