MS Excel: COS Function (WS, VBA)

This Excel tutorial explains how to use the Excel COS function with syntax and examples.

Description

The Microsoft Excel COS function returns the cosine of an angle.

Syntax

The syntax for the Microsoft Excel COS function is:
COS( number )

Parameters or Arguments

number is a numeric value.

Applies To

The COS function can be used in the following versions of Microsoft Excel:
  • Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Excel Function

The COS function can be used in Microsoft Excel as the following type of function:
  • Worksheet function (WS)
  • VBA function (VBA)

Example (as Worksheet Function)

Let's look at some Excel COS function examples and explore how to use the COS function as a worksheet function in Microsoft Excel:
Microsoft Excel
Based on the spreadsheet above, the following Excel COS examples would return:
=COS(A1)
Result: 0.980066578

=COS(A2)
Result: 0.939372713

=COS(A3)
Result: -0.999964658

=COS(200)
Result: 0.487187675

Example (as VBA Function)

The COS function can also be used in VBA code in Microsoft Excel.
Let's look at some Excel COS function examples and explore how to use the COS function in Excel VBA code:
Dim LNumber As Double

LNumber = Cos(210)

Total Pageviews

2016 © BiztechCS
Planer theme by BiztechCS