Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default I would like to copy a date from one cell to another cell

I have a Spreadsheet which contains Weekly Dates from Cell E2 thru AJ2.

If I place an "X" in any of the Cells below these Cells I would like to copy
the date to Column D corrisponding to the Row which has the "X" in it.

i.e. If Cell G5 has an "X" in it I would like to copy the date in G3
(11/7/2008) to Cell D5 (7-Nov-2008)

Is there a standard formular or function to do this? If not could you lead
me down the right path?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default I would like to copy a date from one cell to another cell

You either have 0 X's or exactly 1 X' in each row of columns E:AJ?

If yes, then you could use a formula like:

=SUMIF(E3:AJ3,"x",$E$2:$AJ$2)
And format the results as a date (d-mmm-yyyy)

But you'll see 0 (0-Jan-1900) if there are no X's and you'll be adding the dates
if there are more than 1 X.

I'd use something like:

=IF(COUNTIF(E3:AJ3,"X")=0,"",
IF(COUNTIF(E3:AJ3,"x")1,"Too many X's",
SUMIF(E3:AJ3,"x",$E$2:$AJ$2)))

The cell will appear empty if there are no x's and give a warning if there is
more than a single X.



Dr. Darrell wrote:

I have a Spreadsheet which contains Weekly Dates from Cell E2 thru AJ2.

If I place an "X" in any of the Cells below these Cells I would like to copy
the date to Column D corrisponding to the Row which has the "X" in it.

i.e. If Cell G5 has an "X" in it I would like to copy the date in G3
(11/7/2008) to Cell D5 (7-Nov-2008)

Is there a standard formular or function to do this? If not could you lead
me down the right path?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default I would like to copy a date from one cell to another cell

Please clarify. Give us a better idea of what is in the worksheet (just
enough rows and columns for us to get the picture). Are the dates in E2:AJ2
or E2:AJ(N) where N 2?

In your example, could the X by in G10 and you want date from G8?

Or should the example read: i.e. If Cell G5 has an "X" in it I would like to
copy the date in G2 (NOT G3)? I will assume this to be true
Then in D5 use =SUMPRODUCT(--(E5:AJ5="X"),$E$2:$AJ$2) copy this to other D
cells as needed
It will work if there is only one X in a row
You will need to format D5 first as it will display a serial number like
39449
best wishes

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Dr. Darrell" wrote in message
...
I have a Spreadsheet which contains Weekly Dates from Cell E2 thru AJ2.

If I place an "X" in any of the Cells below these Cells I would like to
copy
the date to Column D corrisponding to the Row which has the "X" in it.

i.e. If Cell G5 has an "X" in it I would like to copy the date in G3
(11/7/2008) to Cell D5 (7-Nov-2008)

Is there a standard formular or function to do this? If not could you lead
me down the right path?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default I would like to copy a date from one cell to another cell

Thank you, I have inserted the first formula and it works very well.

"Dave Peterson" wrote:

You either have 0 X's or exactly 1 X' in each row of columns E:AJ?

If yes, then you could use a formula like:

=SUMIF(E3:AJ3,"x",$E$2:$AJ$2)
And format the results as a date (d-mmm-yyyy)

But you'll see 0 (0-Jan-1900) if there are no X's and you'll be adding the dates
if there are more than 1 X.

I'd use something like:

=IF(COUNTIF(E3:AJ3,"X")=0,"",
IF(COUNTIF(E3:AJ3,"x")1,"Too many X's",
SUMIF(E3:AJ3,"x",$E$2:$AJ$2)))

The cell will appear empty if there are no x's and give a warning if there is
more than a single X.



Dr. Darrell wrote:

I have a Spreadsheet which contains Weekly Dates from Cell E2 thru AJ2.

If I place an "X" in any of the Cells below these Cells I would like to copy
the date to Column D corrisponding to the Row which has the "X" in it.

i.e. If Cell G5 has an "X" in it I would like to copy the date in G3
(11/7/2008) to Cell D5 (7-Nov-2008)

Is there a standard formular or function to do this? If not could you lead
me down the right path?


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy date in a cell if within a date range carrerapaolo Excel Discussion (Misc queries) 2 April 19th 10 09:12 PM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
copy cell based on date Dreamstar_1961 Excel Worksheet Functions 4 July 15th 07 07:59 AM
COPY SAME DATE/CELL TO EVERY SHEET? Steve Excel Discussion (Misc queries) 8 October 2nd 06 07:25 PM
I want to copy a cell by date if Cell = Today() then... quickquestion Excel Discussion (Misc queries) 3 May 16th 06 01:12 PM


All times are GMT +1. The time now is 05:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"