Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-27-2014, 12:23 AM
Nisio07 Nisio07 is offline Macro to format unpredictable data Windows 7 64bit Macro to format unpredictable data Office 2007
Novice
Macro to format unpredictable data
 
Join Date: Sep 2014
Posts: 21
Nisio07 is on a distinguished road
Default Macro to format unpredictable data

I have attached a sample file of data I download on a weekly basis. It generated total time spent by various students. Unfortunately, the time is unpredictable. All fields come trailing with the words "hours or "minutes". These can be easily removed but it what them happens which is nuts! the time can be formatted as mm:ss, hh:mm:ss or yy dd mm hh:mm:ss. If you view the attached you will see more clearly. (Column C is a simple value paste of column b with the word " minutes" removed)



Is there any macro that will cater for all these possible formats and just give me a column contain the time value in minutes? BTW, there really is no way of altering the format of the incoming data. I wish to rank students in time spent so this need the time data in comparable, numeric format.

Any help greatly appreciated.

Regards

Nisio
Attached Files
File Type: xlsx msof query.xlsx (8.4 KB, 10 views)
Reply With Quote
  #2  
Old 09-29-2014, 09:37 AM
gebobs gebobs is offline Macro to format unpredictable data Windows 7 64bit Macro to format unpredictable data Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

First, I would ask that the data be generated in a more suitable format. Have all data in the time column exported as hh:mm:ss with no succeeding text.

But you can work with the data on hand until then by entering a conversion equation to the right (here for the data on line 2):

=LEFT(B2, FIND(" ",B2)-1)/IF(RIGHT(B2,5)="Hours",1,60)

See attached. I formatted the column C as h:mm:ss so the complete time is shown.
Attached Files
File Type: xlsx msof query.xlsx (9.0 KB, 8 views)
Reply With Quote
  #3  
Old 09-30-2014, 01:16 PM
Nisio07 Nisio07 is offline Macro to format unpredictable data Windows 7 64bit Macro to format unpredictable data Office 2007
Novice
Macro to format unpredictable data
 
Join Date: Sep 2014
Posts: 21
Nisio07 is on a distinguished road
Default

Gebobs is described as "competent performer".. That is lie ...; Better words would be GENIUS... EXPERT .. EXCELLENT EXCEL-LER ... Change that tag line quickly... Many thanks ... Brilliant non-macro solution...
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to format unpredictable data Mailmerge Data Format tombradley Mail Merge 1 09-29-2013 07:35 PM
Macro to format unpredictable data How to format WORD data using edit field? Azuki Mail Merge 2 04-01-2013 06:08 PM
Macro to format unpredictable data macro to format this ubns Word 3 04-24-2012 11:44 PM
Changing format of time data Sammael Excel 2 04-08-2012 12:13 PM
Macro to format unpredictable data Excel 2007 and data in dd:hh:mm:ss format Sammael Excel 6 11-05-2011 06:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft