Move Date to fill in time/date area

Sailman

New Member
Joined
Jan 27, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Goal is to move the Date from column B to Column A on rows that have a time and event and details .
the row with the date currently is blank except for column B.
this is for 90 days worth of data on a regular basis for 4 different spreadsheets.
 

Attachments

  • Move-Date.png
    Move-Date.png
    44.6 KB · Views: 5

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi Sailman,

A couple of questions:
  1. Are you sure the times only have a time and not the date and time? Click on that 4:30:12 cell and see what appears in the formula bar; is it just the time or something like 1/1/2021 4:30:12 AM ?
  2. When you say "rows that have a time and event and details" do you mean both are non-zero? e.g. what about "Denied" and Details of zero, should they also have the date?
 
Upvote 0
Pending your response here's a version which puts the year if columns C and D aren't blank:

Sailman.xlsx
ABCD
4DateDate/TimeEventDetails
502-Jan-21
602-Jan-214:30:12Okay112.3
702-Jan-214:30:12Denied0
802-Jan-214:30:12Okay112.3
902-Jan-214:30:12Denied112.3
1002-Jan-214:30:12Okay112.3
1102-Jan-214:30:12Denied112.3
1202-Jan-214:30:12Okay112.3
1302-Jan-214:30:12Denied112.3
14 03-Jan-21
1503-Jan-214:30:12Okay112.3
1603-Jan-214:30:12Denied112.3
1703-Jan-214:30:12Okay112.3
1803-Jan-214:30:12Denied112.3
19 
Sheet1
Cell Formulas
RangeFormula
A6:A19A6=IF(C6&D6="","",INDEX($B$5:$B$19,AGGREGATE(14,6,ROW($B$5:$B$19)-ROW($B$4)/(($B$5:$B$19>1)*($C$5:$C$19="")*(ROW($D$5:$D$19)<ROW())),1)))
 
Upvote 0
Thank you for this help, yes the C and D columns are blank where there are dates in Column B.
the time is just the time.
I tried your formula, it may take me a few times to figure out all the ins and outs but I think I understand the general direction you are going with the formula.
Index seems to be good idea, and maybe create a value on with the date value.
 
Upvote 0
Here, let me explain.

=IF(C6&D6="",""
If Event and Details are blank for this row then there's no need for the date.

INDEX($B$5:$B$19
I want the date so I need to retrieve from column B

AGGREGATE(14,6,ROW($B$5:$B$19)-ROW($B$4)/
I want to retrieve the latest ate so I use the LARGE function of AGGREGATE and check every row. Next I will divide each row number by the results of three logical comparisons multiplied, so only if all three conditions are true will I return a logical one which divided into the row gives me the row number meeting the criteria. i.e. the row with the date.

(($B$5:$B$19>1)*($C$5:$C$19="")*(ROW($D$5:$D$19)<ROW())),1)))
Here's the three criteria:​
(($B$5:$B$19>1)*​
The B column must be greater than 1, so it won't be text or time (as time is held as a fraction of 1).​
($C$5:$C$19="")*​
The C column must be blank, so I know it's not an Event/Detail row.​
(ROW($D$5:$D$19)<ROW())​
The Date it finds must be in a row less than the current row.​

So INDEX retrieve the contents of B where I find the highest row with a date before the row I'm on.
 
Upvote 0

Forum statistics

Threads
1,215,824
Messages
6,127,081
Members
449,358
Latest member
Snowinx

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