Question: I am trying to write the following function in Excel.

if P2 is greater than or equal to 3 and AD2 is 0
OR
if P2 is greater than or equal to 2 and AD2 is greater than or equal to 1
OR 
if P2 is greater than or equal to 1 and AD2 is 2

Then do the following:
(H2+V2)/(P2+AD2),-999)

I have had a go at writing the following to no avail.

=IF(AND(P2>=3,AD2>=0),OR(AND(P2>=2,AD2>=1)),OR(AND(P2>=1,AD2>=2)),(H2+V2)/(P2+AD2),-999)

Any pointers in the right direction would be much appreciated as I am a novice at Excel functions.

Many thanks,

Ash

Answer: 
> 
> Quicksort gained widespread adoption, appearing, for example, in Unix as the default library sort function, whence it lent its name to the C standard library function qsort and in the reference implementation of Java. 
> 
> 
> Merge sort type algorithms allowed large data sets to be sorted on early computers that had small random access memories by modern standards. Records were stored on magnetic tape and processed on banks of magnetic tape drives . merge sort is implemented with disk drives. 
> 
> 
> 

For more read : <http://en.wikipedia.org/wiki/Merge_sort>  

<http://en.wikipedia.org/wiki/Quicksort#References>
Their applications vary; it depends on the size and contents of what you're sorting.

Quicksort is one of the fastest sorting algorithms, so it is commonly used in commercial applications.

Merge sort is used mostly under size constraints because it isn't as hefty an algorithm as Quicksort.