Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Convert wind direction to degrees

I'm sure this is a simple problem but I'm stupid. I have a
column with wind direction (N,NNE,NE...) and I need to convert
it to a numerical representation (0,22.5,45...). The spreadsheet
has about 20,000 rows so I need to automate this. I have a
mental picture how this needs to happen but I have no idea of
the syntax necessary.

Set a counter
Read a cell
If cell is empty quit
Select Case statement
Assign degree value to variable
Write variable to adjacent cell
Increment counter
Do again

Can anyone out there help me get started. I can get the select
statements but I have no idea how to programatically read and
write to cells.

Thanks,
Larry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Convert wind direction to degrees

Larry

Your best bet is to set up the Wind Directions on a seperate sheet as follows:

COL A COL B
- -
WindDir WindDeg
N 0
NNE 22,5
NE 45
ENE 67.5
.... ...

And then just use a Vlookup worksheet function to get the degrees - see
funcion help if you are unfamiliar with vlookups.

Regards
Rowan

"Larry" wrote:

I'm sure this is a simple problem but I'm stupid. I have a
column with wind direction (N,NNE,NE...) and I need to convert
it to a numerical representation (0,22.5,45...). The spreadsheet
has about 20,000 rows so I need to automate this. I have a
mental picture how this needs to happen but I have no idea of
the syntax necessary.

Set a counter
Read a cell
If cell is empty quit
Select Case statement
Assign degree value to variable
Write variable to adjacent cell
Increment counter
Do again

Can anyone out there help me get started. I can get the select
statements but I have no idea how to programatically read and
write to cells.

Thanks,
Larry

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Convert wind direction to degrees

"?B?Um93YW4=?="
wrote in
:

I read the function help but you didn't read the first line of
my message. ;O} I've got what you indicated below on sheet2,
a1:b16. I've got the wind dir in sheet1 column I. Column J is
what I'm trying to populate. From what I can figure out I
should have a cell somewhere on sheet1 with the following.
=VLOOKUP(9,Sheet2!A1:B16,10,FALSE)
That returns #N/A. What's up with that. I think I'm close but
I just don't see it.

Larry

Larry

Your best bet is to set up the Wind Directions on a
seperate sheet as follows:

COL A COL B
- -
WindDir WindDeg
N 0
NNE 22,5
NE 45
ENE 67.5
... ...

And then just use a Vlookup worksheet function to get the
degrees - see funcion help if you are unfamiliar with
vlookups.

Regards
Rowan

"Larry" wrote:

I'm sure this is a simple problem but I'm stupid. I have a
column with wind direction (N,NNE,NE...) and I need to
convert it to a numerical representation (0,22.5,45...).
The spreadsheet has about 20,000 rows so I need to
automate this. I have a mental picture how this needs to
happen but I have no idea of the syntax necessary.

Set a counter
Read a cell
If cell is empty quit
Select Case statement
Assign degree value to variable
Write variable to adjacent cell
Increment counter
Do again

Can anyone out there help me get started. I can get the
select statements but I have no idea how to
programatically read and write to cells.

Thanks,
Larry




--
Why, if aliens are smart enough
to travel light years through
space, do they keep abducting
the dumbest people on earth?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Convert wind direction to degrees

I hope you get this reply - it's been a while.

Assuming your column with wind direction on sheet1 (main data sheet) is
column F then in the column where you want the numerical representation you
need the formual =VLOOKUP(F1,$A$1:$B$16,2,0)

You could replace the 0 at the end with false - it is the same thing.

Hope this helps
Rowan

"Larry" wrote:

I'm sure this is a simple problem but I'm stupid. I have a
column with wind direction (N,NNE,NE...) and I need to convert
it to a numerical representation (0,22.5,45...). The spreadsheet
has about 20,000 rows so I need to automate this. I have a
mental picture how this needs to happen but I have no idea of
the syntax necessary.

Set a counter
Read a cell
If cell is empty quit
Select Case statement
Assign degree value to variable
Write variable to adjacent cell
Increment counter
Do again

Can anyone out there help me get started. I can get the select
statements but I have no idea how to programatically read and
write to cells.

Thanks,
Larry

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Convert wind direction to degrees

Looks like queries answered in http://excelforum.com do not get
reflected here. For instance, check the link for this thread:
http://excelforum.com/showthread.php...nvert+wind+dir
ection+degrees

- Mangesh


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Convert wind direction to degrees

Sorry, I meant. When a query is answered through excelforum.com, they
don't get reflected in developersdex.

Mangesh

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plotting wind speed and direction on a compass? WalterKiwi Charts and Charting in Excel 8 November 11th 09 05:31 PM
Average Wind Direction rexmorgan Excel Worksheet Functions 3 October 18th 05 04:30 AM
correcting wind direction data big eye Excel Discussion (Misc queries) 3 August 6th 05 12:11 AM
Average wind direction Phil Excel Discussion (Misc queries) 12 July 26th 05 12:02 PM
wind direction TC Excel Discussion (Misc queries) 3 July 14th 05 06:23 PM


All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"