LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can a function return two values?

Is it possible for a function to return two values to be
used in another function?

Suppose I need a function "ff" to calculate two variables
called "station" and "offset". Is it possible to return
both these variables to be used in another function
called "elevation(station, offset)"?

A very rough algorithm follows -

Function GE()
'This is the main function
Dim a as long

Call ff(a)
GE = elevation(station, offset)

End Function

Function ff( var as long)
'Returns station and offset to the main function

station = a +1
offset = a^2+1

'How do I return both station and offset?
??
End Function

Function elevation (station as long, offset as long)

elevation = station + offset (for simplicity)

End Function

THANKS IN ADVANCE.










 
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
Address function to return values from min row Laury Excel Discussion (Misc queries) 3 October 4th 07 07:59 PM
IF Function with multiple return values jerminski73 Excel Worksheet Functions 6 April 28th 07 12:16 AM
A Function to Return Top 5 Values Only Sean Excel Worksheet Functions 4 December 29th 06 12:34 PM
How can I use the vlookup function to return a sum of the values? Chaandni Excel Discussion (Misc queries) 4 November 7th 05 03:05 PM
vlookup function return all values j2thea Excel Worksheet Functions 20 November 2nd 05 10:32 PM


All times are GMT +1. The time now is 02:24 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"