+ Reply to Thread
Results 1 to 24 of 24

VBA Arrange date wise rows data in single column

Hybrid View

nitemath2 VBA Arrange date wise rows... 05-10-2023, 05:29 AM
Glenn Kennedy Re: Arrange date wise rows... 05-10-2023, 05:43 AM
nitemath2 Re: Arrange date wise rows... 05-10-2023, 05:55 AM
AskMeAboutExcel Re: Arrange date wise rows... 05-10-2023, 05:47 AM
nitemath2 Re: Arrange date wise rows... 05-10-2023, 06:02 AM
Glenn Kennedy Re: Arrange date wise rows... 05-10-2023, 05:57 AM
nitemath2 Re: Arrange date wise rows... 05-10-2023, 06:03 AM
Glenn Kennedy Re: Arrange date wise rows... 05-10-2023, 06:04 AM
AliGW Re: Arrange date wise rows... 05-10-2023, 06:04 AM
Glenn Kennedy Re: Arrange date wise rows... 05-10-2023, 06:05 AM
nitemath2 Re: Arrange date wise rows... 05-10-2023, 06:08 AM
AliGW Re: Arrange date wise rows... 05-10-2023, 06:13 AM
nitemath2 Re: Arrange date wise rows... 05-10-2023, 06:17 AM
AliGW Re: Arrange date wise rows... 05-10-2023, 06:18 AM
nitemath2 Re: Arrange date wise rows... 05-10-2023, 06:25 AM
AliGW Re: Arrange date wise rows... 05-10-2023, 06:26 AM
AskMeAboutExcel Re: VBA Arrange date wise... 05-10-2023, 06:46 AM
nitemath2 Re: VBA Arrange date wise... 05-10-2023, 07:07 AM
AliGW Re: VBA Arrange date wise... 05-10-2023, 06:54 AM
AskMeAboutExcel Re: VBA Arrange date wise... 05-10-2023, 07:45 AM
nitemath2 Re: VBA Arrange date wise... 05-10-2023, 07:57 AM
Glenn Kennedy Re: VBA Arrange date wise... 05-10-2023, 08:41 AM
AskMeAboutExcel Re: VBA Arrange date wise... 05-10-2023, 08:46 AM
AliGW Re: VBA Arrange date wise... 05-11-2023, 06:58 AM
  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    VBA Arrange date wise rows data in single column

    HI,

    I want to arrange date wise rows in single column. Sample sheet attached with expected result.

    Thanks
    Attached Files Attached Files
    Last edited by AliGW; 05-10-2023 at 06:27 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Arrange date wise rows data in single column

    You can do this easily with a formula. DELETE all expected results, first.

    Formula: copy to clipboard
    =LET(A,B2:C71,B,UNIQUE(INDEX(A,,1)),C,IFERROR(DROP(REDUCE(0,B,LAMBDA(x,y,VSTACK(x,TRANSPOSE(FILTER(INDEX(A,,2),INDEX(A,,1)=y))))),1),""),HSTACK(B,C))


    Format the date column as date, and the time columns as time.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    Re: Arrange date wise rows data in single column

    Hi Glenn, formula is not working. showing error. Please suggest

  4. #4
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Arrange date wise rows data in single column

    Or a much less exciting but manual method (Cell J2 and copy down/across)

    Formula: copy to clipboard
    =MINIFS(  $C:$C,  $B:$B,  $I2,  $E:$E, TRIM(LEFT(J$1,9)),  $C:$C,  ">"&IF(I2>1,0,I2) )
    <<< If you have valued anyone's contributions in this thread, please click * to thank them for their efforts

  5. #5
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    Re: Arrange date wise rows data in single column

    Sorry this formula is not working on my data set

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Arrange date wise rows data in single column

    What VERSION of O365 do you have. You can find this in your account page.

  7. #7
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    Re: Arrange date wise rows data in single column

    HI ,
    I am using MS Office 2016

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Arrange date wise rows data in single column

    Version is shown here:
    Attached Images Attached Images

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,256

    Re: Arrange date wise rows data in single column

    I am using MS Office 2016
    Then why does your profile say Office 365??? Please get that changed NOW.

    The formula in post #3 DOES work on your dataset, so the question is: what is different about your REAL dataset compared to the sample you shared?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Arrange date wise rows data in single column

    Why does your profile say O365????????

  11. #11
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    Re: Arrange date wise rows data in single column

    sorry for the inconvenience. I have corrected my version in my profile.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,256

    Re: Arrange date wise rows data in single column

    Please answer my question in post #9.

  13. #13
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    Re: Arrange date wise rows data in single column

    Sample file attached with using formula in post 3. Formula is showing error.
    Attached Files Attached Files

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,256

    Re: Arrange date wise rows data in single column

    No - that's what you posted before. Please share a version showing the solution in post #3 - we need to see what errors you are getting.

    EDIT: Sorry - just realised that it uses MINIFS, which you don't have.
    Last edited by AliGW; 05-10-2023 at 06:21 AM.

  15. #15
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    Re: Arrange date wise rows data in single column

    File attached with using of formula in post 3. Please check and do the needful.
    Attached Files Attached Files

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,256

    Re: Arrange date wise rows data in single column

    Yes, sorry - you don't have MINIFS.

    Having the wrong product in your profile has wasted a lot of time for you today.

    Let's hope that someone will be able to give you a solution for Excel 2016. Good luck!

  17. #17
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: VBA Arrange date wise rows data in single column

    For 2016, try this instead in cell J2 - and adjust the ranges as required

    Formula: copy to clipboard
    =MIN(IF(($B2:$B9999=$I2)*($E2:$E9999=TRIM(LEFT(J$1,9)))*($C2:$C9999>IF(I2>1,0,I2)),$C2:$C9999))

  18. #18
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    Re: VBA Arrange date wise rows data in single column

    HI thanks for the Solution and it is working but when i drag it to columns it dont stop stop showing values. Example : IF we I continue drag it from cell J2 (where date is 1st May) than it is showing till Nth column, rather showing till the date is 1st May. Any possibilities to correct it.

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,256

    Re: VBA Arrange date wise rows data in single column

    I think this will need array entering.

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

  20. #20
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: VBA Arrange date wise rows data in single column

    Are you entering this as an array formula as explained by AliGW? If not, follow this and see if it works.

    Otherwise can you post a screenshot of what you are seeing, as I don't follow the description and can't replicate the issue with a different version of excel.

  21. #21
    Registered User
    Join Date
    04-02-2013
    Location
    India
    MS-Off Ver
    MS Office 2019
    Posts
    51

    Re: VBA Arrange date wise rows data in single column

    Yes, I exactly followed that. please see the attached file screen shot , where, after a zero it shows same value as showing in starting. I need to remove it through formula not manual
    Attached Files Attached Files

  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: VBA Arrange date wise rows data in single column

    You didn't really ANSWER my Q about WHY your profile showed O365, when you are ACTUALLY using a much older product...

    I2, copied down:
    =IFERROR(INDEX($B$2:$B$71,MATCH(1,INDEX(--ISNA(MATCH($B$2:$B$71,I$1:I1,)),),)),"")

    J2, copied across and down.
    =IFERROR(INDEX($C:$C,AGGREGATE(15,6,ROW($C$2:$C$71)/($B$2:$B$71=$I2),COLUMNS($J2:J2))),"")

    Both formula need only ENTER...
    Attached Files Attached Files

  23. #23
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: VBA Arrange date wise rows data in single column

    ah, I see. A bit lengthy, but you can try something like this (entered with control+shift+enter)
    Formula: copy to clipboard
    =IF(  OR(  I2="-",  I2=MAX(IF($B$2:$B$9999=$I2,$C$2:$C$9999))  ),  "-",  MIN( IF( ($B2:$B9999=$I2) * ($E2:$E9999=TRIM(LEFT(J$1,9))) * ($C2:$C9999 > IF( I2>1,0,I2) ), $C2:$C9999)  )  )

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,256

    Re: VBA Arrange date wise rows data in single column

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 03-18-2021, 01:06 PM
  2. Replies: 4
    Last Post: 05-01-2020, 01:10 AM
  3. Arrange data year-wise for individual team
    By dibyendu2280 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-22-2019, 09:05 AM
  4. [SOLVED] need to arrange column wise data to row wise with monthly wise
    By alok.gupta4ever in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-03-2016, 11:11 AM
  5. Replies: 1
    Last Post: 04-06-2016, 07:02 AM
  6. Remove data category wise in Single column
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2015, 03:11 PM
  7. Replies: 4
    Last Post: 08-01-2012, 09:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1