+ Reply to Thread
Results 1 to 23 of 23

I need help converting pasted data to it's correct value so I can sort properly

  1. #1
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    I need help converting pasted data to it's correct value so I can sort properly

    In the example worksheet, you'll see in columns A, B and C you see what looks like the date, time and numbers but since they were pasted all are text values I believe.

    I column A, I need the values to be the actual date value.

    I need to convert column B to actual time value so I can have either 12 hours or 24-hour format.

    In column C, I have names

    In column I have numbers


    Once I can convert all the pasted text to the actual date, time formats. Once I get that done I need to be able to enter a name in column "H" and have it query column D and C and enter the total amount for each name.


    I only know enough about Excel 2010 to get myself in trouble. I had this formula once before but somehow it got deleted by mistake. IF someone would be kind enough to show me how to do everything I listed above I would appreciate it very much.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Here is a VBA solution to convert Columns A and B.

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button


    In I8 type =SUMIFS($D$3:$D$500,$C$3:$C$500,H8) and copy down
    Last edited by alansidman; 06-23-2018 at 09:09 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    thanks for the help but as I said I don't know much about Excel and I know NOTHING about VBA So I will never be able to understand what I am doing using your way.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

    I have given you explicit instructions on how to make it work. Try it out. It is converting the text to dates and times as requested using the Format function. Alternatively, to make this work with formulas, you will need to have helper columns as you cannot change existing cells using formulas. If you wish to go that direction then look at this link https://www.ablebits.com/office-addi...ert-text-date/

  5. #5
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    I appreciate your time you spent trying to help me but I know that VBA is out of my league, I may be able to follow your instructions and get in done, however, I won't understand what I did. Plus you didn't address the formula for the totals section???

    Maybe somene will reply with an easier way to do the same thing without VBA.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

    I offered you a link to a formula based solution in post 4. As to the second request, you have not indicated how you wish the data to be accumulated. What is the criteria for accumulating the data. One column is a time and the other column is a number. How are these related and what should the total be based upon.

  7. #7
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Once I get the date and time in the proper formats, I need to have a formula that will search column with the names and numbers and give me a result for each name. As I add more names and amounts the formula will always update the section that has the totals. I hope that explains what I need to do with this data

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

    In I8 type =SUMIFS($D$3:$D$500,$C$3:$C$500,H8) and copy down

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Helper column in E3 to produce real date :
    Please Login or Register  to view this content.
    Copy/paste special back to A3 if needed.
    Time in B column I believe it is real time.
    Quang PT

  10. #10
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Thanks,alansidman for the formula, I tried it and it works.
    Now I just need to make sure the date and time
    are actual dates and time and not text since I pasted it.

    Shouldn't I be able to right-click on the columns and select the format I want for each column and that will
    convert the text ( if it is text )

  11. #11
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Quote Originally Posted by bebo021999 View Post
    Helper column in E3 to produce real date :
    Please Login or Register  to view this content.
    Copy/paste special back to A3 if needed.
    Time in B column I believe it is real time.
    Thanks Bob, I'm looking for a simple way that I can understand. I haven't a clue what your example means or what or how it works.

    Guys I am trying to do this the simplest way possible so I can remember how to do it in the future, sticking to ways I understand will do that for me

  12. #12
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Quote Originally Posted by alansidman View Post
    In I8 type =SUMIFS($D$3:$D$500,$C$3:$C$500,H8) and copy down
    Alan,

    I wanted the formula to work if I added a new name and amount then all I would have to do is add the new name to the list of names in column H and it would add the total. that dind't work, it worked with the names in my example but not when I added a new name and amount?

    UPDATE:
    I noticed you only wrote the formula to go to row 500 like my example, as it only had 500 rows. I changed the 500 to 5000 and now if I add a new name and amount it works fine!! thanks


    Still trying to figure a way to get the date and time the correct format on the worksheet without using VBA
    Last edited by Eaglepi; 06-23-2018 at 08:54 AM.

  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Did you look at the link I provided in post 4. It offers several solutions to converting the dates and explains how and why they work.

  14. #14
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Doing that now

  15. #15
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Quote Originally Posted by alansidman View Post
    Did you look at the link I provided in post 4. It offers several solutions to converting the dates and explains how and why they work.
    When I follow the instructions on the link your provided I get a #VALUE!

  16. #16
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

    I have a solution for you but it is multi step and may not be any easier for you than what Bebo has offered.
    1. Highlight Column A and then select Data--Text to Columns on the Ribbon
    2. Delimit the range with Space
    3. Have the wizard paste the new data in E3. You may have to move your list of names to avoid them being overwritten with this new data.
    4. In Column N. Type each month as shown in Column A. ie. Jan, Feb, Mar, etc
    5. In column O. type the month number next to each month, ie. 1, 2, 3, etc
    6. In H3, type =DATE(G3,VLOOKUP(E3,$N$3:$O$14,2,0),F3)
    7. Copy formula in H3 down.
    8. Highlight H3 down to the last item and copy
    9. Position your cursor in A2 and paste special values.

    Lengthy, but it does work and you should be able to understand.

  17. #17
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Quote Originally Posted by alansidman View Post
    I have a solution for you but it is multi step and may not be any easier for you than what Bebo has offered.
    1. Highlight Column A and then select Data--Text to Columns on the Ribbon
    2. Delimit the range with Space
    3. Have the wizard paste the new data in E3. You may have to move your list of names to avoid them being overwritten with this new data.
    4. In Column N. Type each month as shown in Column A. ie. Jan, Feb, Mar, etc
    5. In column O. type the month number next to each month, ie. 1, 2, 3, etc
    6. In H3, type =DATE(G3,VLOOKUP(E3,$N$3:$O$14,2,0),F3)
    7. Copy formula in H3 down.
    8. Highlight H3 down to the last item and copy
    9. Position your cursor in A2 and paste special values.

    Lengthy, but it does work and you should be able to understand.

    First of all, you said, "I have a solution for you but it is multi-step and may not be any easier for you than what Bebo has offered." That may be true but Bebo really didn't explain how to do his method, I stilll appreiate his effeort to help me.

    in your very detailed explaination I do not see "Data--Text to Columns" on any of my ribbions. I see more than I wonder if I will be able to follow it but I need to do it one step at a time for now and looking for the Data--Text to Columns is what I am doing now. if you see this reply please tell me which ribbon and approximately where it is. that will help me a lot.

  18. #18
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Quote Originally Posted by alansidman View Post
    I have a solution for you but it is multi step and may not be any easier for you than what Bebo has offered.
    1. Highlight Column A and then select Data--Text to Columns on the Ribbon
    2. Delimit the range with Space
    3. Have the wizard paste the new data in E3. You may have to move your list of names to avoid them being overwritten with this new data.
    4. In Column N. Type each month as shown in Column A. ie. Jan, Feb, Mar, etc
    5. In column O. type the month number next to each month, ie. 1, 2, 3, etc
    6. In H3, type =DATE(G3,VLOOKUP(E3,$N$3:$O$14,2,0),F3)
    7. Copy formula in H3 down.
    8. Highlight H3 down to the last item and copy
    9. Position your cursor in A2 and paste special values.

    Lengthy, but it does work and you should be able to understand.
    OK I got what you meant, ON the "data" tab select text to column. I tried it and it didn't have an option to "Have the wizard paste the new data in E3" So I couldn't get past that part.

    My time is formatted as time, the formula you gave me works fine with the little adjustment I made from row 500 to row 5000 it will handle any entries I will ever have to enter.

    So now the only problem I have left is the column A Dates is not formatted correctly, I try to sort by column A ( sort by date ) abd it sorts but it sorts Apr all years. It should sort with first month and year and so on now it sorts all April 2012 then May 2012 then June 2012 it should go Jan 2012 through June 2018

  19. #19
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Here is a tutorial on Text to columns.

    https://www.excel-easy.com/examples/...o-columns.html

  20. #20
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Quote Originally Posted by alansidman View Post
    Here is a tutorial on Text to columns.

    https://www.excel-easy.com/examples/...o-columns.html
    I know how to use text to columns although I wouldn't say I know it very well. Even in the tutorial link, you posted there was nothing about having text to columns paste anything to a specfic place like for example "E3" and since that is the place that I got stuck in your steps I am still unable to complete your instuctions. Thansk for trying to help.

    Update:
    I tried it without using Delimit with no space, since a space divided the month, day and year and that is defeating the whole purpose. Once I was done with text to column not using the "space" it did change the dates in column A to a actural date not just text. and with your formula I will be able to do what I wanted to do.


    I am sorry I wasn't skilled enough to understand your help right away but in the end I did get my problem so;lved with your help.

    Thank you very much


    the range with Space
    3. Have the wizard paste the new data in E3. You may have to move your list of names to avoid them being overwritten with this new data.
    Last edited by Eaglepi; 06-23-2018 at 01:09 PM.

  21. #21
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Here is a picture of the step that you need to do to get the data into cells E3:G3

    Capture.JPG

  22. #22
    Registered User
    Join Date
    06-02-2017
    Location
    USA
    MS-Off Ver
    2021
    Posts
    90

    Re: I need help converting pasted data to it's correct value so I can sort properly

    Quote Originally Posted by alansidman View Post
    Here is a picture of the step that you need to do to get the data into cells E3:G3

    Attachment 579197
    For some reason it will not allow me to open your image, when I wasn't logging in I
    saw the link but once I logged in there was no longer a link. I think I can do it
    now with your formula and now that I got all the columns formatted to what they
    should be. Now all I have to do is put your formula into the first cell of
    the names. I am using this formula you gave me the first time =SUMIFS($D$3:$D$500,$C$3:$C$500,H8) and copy down

    I did it a bit different, I didn't have to use this formula "=DATE(G3,VLOOKUP(E3,$N$3:$O$14,2,0),F3)" Not sure what that one was supposed to do but now that I got my dates in the correct format everything works fine. I will attach the emaple to this post and you can try it yourself to see if it will work. all you ahve to do is add a date, time name and amount and then go to column"H" type the name you added and the amoooount shold fill in and that is exactly what I needed this worksheet dto do.
    Attached Files Attached Files

  23. #23
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: I need help converting pasted data to it's correct value so I can sort properly

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

+ 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. Sort data by font colour not working properly
    By exlex in forum Excel General
    Replies: 6
    Last Post: 03-18-2014, 03:11 PM
  2. How to Correct This Formula from Converting When Pasted Used VBA
    By CHRISOK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2014, 09:16 PM
  3. Replies: 1
    Last Post: 05-05-2013, 10:38 PM
  4. [SOLVED] Auto sort data with headings/titles when pasted
    By PWinkz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2013, 10:35 AM
  5. Replies: 3
    Last Post: 01-26-2009, 05:50 PM
  6. [SOLVED] Excel 2003 Data Sort & Subtotaling not working properly
    By Roibn L Taylor in forum Excel General
    Replies: 5
    Last Post: 12-08-2005, 02:10 PM
  7. [SOLVED] Converting data from a pasted document
    By Dave in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-04-2005, 12:06 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