Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 16th, 2003, 12:02 PM
Authorized User
Join Date: Oct 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to calculate median value

Hi All,

I have 4 numbers (84, 88, 91, and 93) and trying to get the median value.

I know which numbers I need to get but I am having hard time to sort them. (Median value = 88+91/2)

Any help is welcome...


Reply With Quote
  #2 (permalink)  
Old December 16th, 2003, 12:06 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post

VBS has no built-in sort functions. If you can use JScript instead it has a built-in sort() for arrays.

Otherwise here's a useful link to sorting algorithms coded in VB:

Reply With Quote
  #3 (permalink)  
Old December 17th, 2003, 03:54 PM
Authorized User
Join Date: Oct 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts

Thank you Phil, I used the link...

I sorted the numbers and calculated the median..

Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate time divovsky Access 2 March 15th, 2007 03:10 PM
how to calculate bandwidth debuajm C# 2005 0 January 16th, 2007 07:40 AM
Calculate ivangr Visual Basic 2005 Basics 0 April 9th, 2006 04:39 AM
calculate 2 textboxes chriskhan2000 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 December 1st, 2005 09:11 PM
Help me How to calculate minhtri VB How-To 4 June 8th, 2004 04:06 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.