Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 10-15-09   #1 (permalink)
PC Gamer
 
amd nvidia

Join Date: Sep 2007
Location: Nebraska
Posts: 773

Rep: 49 PeePs is acknowledged by some
Unique Rep: 42
Trader Rating: 1
Default Quick Excel script help... please =)

I was wondering if anyone here could write me a quick script for Excel that goes through a column of values and changes it to a date format. An example of 1 of the values is "20090807120000[0:GMT]" and they are all very similar like that. So the date for the above example would be 07/12/2009. It would also be helpful, if the script had some sort of way to determine if the value is already in date format and not doing anything with it.

Basically I think all you would have to do is assign the first 4 values to a certain variable, assign the next 2 values to a dif. variable, and then the 5th and 6th values to another variable. Then just have the script return the values in the correct order with a - or / in-between. (and if not too difficult have some sort of check to determine if the value actually needs to be changed to date form).

I'm very bad at programming and don't know any by heart so it would take forever for me to look this up and figure out how to actually accomplish this, although I have the basic idea. Anyone really good with excel / VB programming that could whip this up real fast?

Here is a list of the values so you can use to test:

20090713120000[0:GMT]
20090713120000[0:GMT]
20090821120000[0:GMT]
20090809120000[0:GMT]
20090916120000[0:GMT]
20090728120000[0:GMT]
20090830120000[0:GMT]
20090909120000[0:GMT]
20090721120000[0:GMT]
20090715120000[0:GMT]
20090904120000[0:GMT]
20090904120000[0:GMT]
20090712120000[0:GMT]
20090903120000[0:GMT]
20090806120000[0:GMT]
20090819120000[0:GMT]
20090712120000[0:GMT]
20090824120000[0:GMT]
20090807120000[0:GMT]
20090920120000[0:GMT]
20091004120000[0:GMT]
20090928120000[0:GMT]
20090830120000[0:GMT]
20090904120000[0:GMT]
20090710120000[0:GMT]
20090823120000[0:GMT]
20090823120000[0:GMT]
20090907120000[0:GMT]
20090816120000[0:GMT]
20090927120000[0:GMT]
20090712120000[0:GMT]
20090825120000[0:GMT]
__________________
System: New
CPU
Phenom II X4 955 BE @ 3.8 ghz
Motherboard
GIGABYTE GA-MA790X-UD4P
Memory
4 GB G.SKILL 240-Pin DDR2 SDRAM DDR2 800
Graphics Card
MSI GeForce N9800 GT
Hard Drive
1 TB Western Digital Black Caviar
Sound Card
Creative SB Audigy
Power Supply
Corsair 750TX
Case
Antec 300
CPU cooling
Xigmatek HDT
OS
Windows XP Pro 32 bit
Monitor
Asus 23" 1080p 2 ms
PeePs is offline   Reply With Quote
Old 10-16-09   #2 (permalink)
2 + 2 = 5
 
DuckieHo's Avatar
 
intel nvidia

Join Date: Nov 2006
Location: In a Chair.
Posts: 34,923

Rep: 4172 DuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guru
Unique Rep: 1907
Trader Rating: 56
Default

=if(len(a1)=21,mid(a1,5,2) & "/" & mid(a1,8,2) & "/" & left(a1,4),a1)
__________________
To answer most of your questions: (1) a fridge cannot cool a PC (2) 64-bit OS for over 3.4GB (3) If a PCIe card fits, it should work (4) Resolution, not screen size (5) If you have a question, it is not news (6) Report, not respond to Spam (7) Single-Rail/Non-Modular PSUs are not always better than Multi-Rail/Modular


System: Three Dead Mobos in a Year
CPU
Q6600 (3.4GHz)
Motherboard
EVGA 780i
Memory
2x2GB OCZ Reaper 1096MHz
Graphics Card
GTX260 55nm
Hard Drive
PERC 6/i: 3xRAID0 7200.12 500GB
Sound Card
X-Fi XtremeMusic
Power Supply
Corsair 620HX
Case
Li Lian PC-V2100 [10x120mm fans]
CPU cooling
FuZion V2 + Quad-Heatercore
GPU cooling
EK Block + DDC-3.2
OS
Vista Ultimate 64
Monitor
Samsung 226BW "C" + Sceptre 19"
DuckieHo is online now Overclocked Account DuckieHo's Gallery   Reply With Quote
Old 10-18-09   #3 (permalink)
PC Gamer
 
amd nvidia

Join Date: Sep 2007
Location: Nebraska
Posts: 773

Rep: 49 PeePs is acknowledged by some
Unique Rep: 42
Trader Rating: 1
Default

Welp, I guess I don't have a clue what I'm doing here. Would I input that code in the code window for the sheet or in a cell adjacent to the values I want converted to date form?
__________________
System: New
CPU
Phenom II X4 955 BE @ 3.8 ghz
Motherboard
GIGABYTE GA-MA790X-UD4P
Memory
4 GB G.SKILL 240-Pin DDR2 SDRAM DDR2 800
Graphics Card
MSI GeForce N9800 GT
Hard Drive
1 TB Western Digital Black Caviar
Sound Card
Creative SB Audigy
Power Supply
Corsair 750TX
Case
Antec 300
CPU cooling
Xigmatek HDT
OS
Windows XP Pro 32 bit
Monitor
Asus 23" 1080p 2 ms
PeePs is offline   Reply With Quote
Old 10-19-09   #4 (permalink)
2 + 2 = 5
 
DuckieHo's Avatar
 
intel nvidia

Join Date: Nov 2006
Location: In a Chair.
Posts: 34,923

Rep: 4172 DuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guruDuckieHo is a guru
Unique Rep: 1907
Trader Rating: 56
Default

Quote:
Originally Posted by PeePs View Post
Welp, I guess I don't have a clue what I'm doing here. Would I input that code in the code window for the sheet or in a cell adjacent to the values I want converted to date form?
In any cell in the first row... it references Cell A1.
__________________
To answer most of your questions: (1) a fridge cannot cool a PC (2) 64-bit OS for over 3.4GB (3) If a PCIe card fits, it should work (4) Resolution, not screen size (5) If you have a question, it is not news (6) Report, not respond to Spam (7) Single-Rail/Non-Modular PSUs are not always better than Multi-Rail/Modular


System: Three Dead Mobos in a Year
CPU
Q6600 (3.4GHz)
Motherboard
EVGA 780i
Memory
2x2GB OCZ Reaper 1096MHz
Graphics Card
GTX260 55nm
Hard Drive
PERC 6/i: 3xRAID0 7200.12 500GB
Sound Card
X-Fi XtremeMusic
Power Supply
Corsair 620HX
Case
Li Lian PC-V2100 [10x120mm fans]
CPU cooling
FuZion V2 + Quad-Heatercore
GPU cooling
EK Block + DDC-3.2
OS
Vista Ultimate 64
Monitor
Samsung 226BW "C" + Sceptre 19"
DuckieHo is online now Overclocked Account DuckieHo's Gallery   Reply With Quote
Old 10-19-09   #5 (permalink)
PC Gamer
 
amd nvidia

Join Date: Sep 2007
Location: Nebraska
Posts: 773

Rep: 49 PeePs is acknowledged by some
Unique Rep: 42
Trader Rating: 1
Default

Quote:
Originally Posted by DuckieHo View Post
In any cell in the first row... it references Cell A1.
Works like charm and exactly how I wanted it. Did notice that it was taking the wrong numbers for the day part, but luckily I was barely competent enough to correct it myself . Thanks a bunch I appreciate it!

=if(len(a1)=21,mid(a1,5,2) & "/" & mid(a1,8,2) & "/" & left(a1,4),a1)

=if(len(a1)=21,mid(a1,5,2) & "/" & mid(a1,7,2) & "/" & left(a1,4),a1)
__________________
System: New
CPU
Phenom II X4 955 BE @ 3.8 ghz
Motherboard
GIGABYTE GA-MA790X-UD4P
Memory
4 GB G.SKILL 240-Pin DDR2 SDRAM DDR2 800
Graphics Card
MSI GeForce N9800 GT
Hard Drive
1 TB Western Digital Black Caviar
Sound Card
Creative SB Audigy
Power Supply
Corsair 750TX
Case
Antec 300
CPU cooling
Xigmatek HDT
OS
Windows XP Pro 32 bit
Monitor
Asus 23" 1080p 2 ms
PeePs is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 03:31 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.12896 seconds with 8 queries