POW function
PRO
The POW
function in Jspreadsheet Formulas Pro is a mathematical tool that allows you to raise a number to a specific power. For example, if you were to use POW(2,3)
, it would return 8, because 2 raised to the power of 3 equals 8. This function is very useful for quick calculations involving exponents, helping to simplify your data analysis process.
Documentation
Returns the result of raising a number to a power.
Category
Math and trigonometry
Syntax
POW(number, power)
Parameter | Description |
---|---|
number |
The number to raise to the power. |
power |
The power to raise the number to. |
Behavior
The POW
function is used to raise a number to a power. It takes two parameters - the base and the exponent. The base is the number you want to raise to a power and the exponent is the power by which the base number will be raised.
- If the cells referenced in the function are empty, the function will return an error.
- If the function includes text values, it will return a #VALUE! error.
- Boolean values are treated as numbers, with TRUE regarded as 1 and FALSE as 0.
- If the function encounters an error, it will return that error.
- If a negative number is raised to a fractional power, the function will return a
#NUM!
error since it's mathematically undefined.
Common Errors
Error | Description |
---|---|
#NUM! | Occurs if either the base number is negative, and the power is any real number other than zero, or if the base is zero and the power is less than zero |
#VALUE! | Occurs if either the base number or the power is non-numeric |
Best practices
- Make sure that the cells referenced in the
POW
function contain numerical values. The function does not work with text or boolean values.- Be careful when using negative numbers or zero in your function. Certain combinations can lead to mathematically undefined results, which will cause errors.
- Always check the order of your parameters. The first parameter is the base number and the second parameter is the power.
- Use parentheses to ensure correct order of operations when combining the
POW
function with other functions or mathematical operators.
Usage
A few examples using the POW function.
POW(2, 3) returns 8
POW(10, 2) returns 100
Interactive Spreadsheet Demo
<html>
<script src="https://jspreadsheet.com/v11/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://jspreadsheet.com/v11/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<script src="https://cdn.jsdelivr.net/npm/@jspreadsheet/formula-pro/dist/index.min.js"></script>
<div id="spreadsheet"></div>
<script>
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('OTFlZDRiMTljYmE4ZGJjZDdiNTg2YjQwYjg3MmM5ODkzMzAyODc3ZGE5ZWE0NWVhODc4M2JhNmMzOTExMmUzMzc2NDU5MzUxYjk2N2FjNjRkYzE1NDc0ZDc3ZWJkMzVkNzBjZDc0ZjA3ZTRlNmEzZmNiY2ExYWYxMzQ5MGRlNTMsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXhORFEzTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
[
"Base",
"Exponent",
"Result"
],
[
2,
3,
"=POW(A2,B2)"
],
[
5,
2,
"=POW(A3,B3)"
],
[
10,
4,
"=POW(A4,B4)"
]
]
}]
});
</script>
</html>
import React, { useRef } from "react";
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/react";
import formula from "@jspreadsheet/formula-pro";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
// Set license
jspreadsheet.setLicense('OTFlZDRiMTljYmE4ZGJjZDdiNTg2YjQwYjg3MmM5ODkzMzAyODc3ZGE5ZWE0NWVhODc4M2JhNmMzOTExMmUzMzc2NDU5MzUxYjk2N2FjNjRkYzE1NDc0ZDc3ZWJkMzVkNzBjZDc0ZjA3ZTRlNmEzZmNiY2ExYWYxMzQ5MGRlNTMsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXhORFEzTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default function App() {
// Spreadsheet array of worksheets
const spreadsheet = useRef();
// Worksheet data
const data = [
[
"Base",
"Exponent",
"Result"
],
[
2,
3,
"=POW(A2,B2)"
],
[
5,
2,
"=POW(A3,B3)"
],
[
10,
4,
"=POW(A4,B4)"
]
];
// Render component
return (
<Spreadsheet ref={spreadsheet}>
<Worksheet data={data} />
</Spreadsheet>
);
}
<template>
<Spreadsheet ref="spreadsheet">
<Worksheet :data="data" />
</Spreadsheet>
</template>
<script>
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/vue";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
import formula from "@jspreadsheet/formula-pro";
// Set license
jspreadsheet.setLicense('OTFlZDRiMTljYmE4ZGJjZDdiNTg2YjQwYjg3MmM5ODkzMzAyODc3ZGE5ZWE0NWVhODc4M2JhNmMzOTExMmUzMzc2NDU5MzUxYjk2N2FjNjRkYzE1NDc0ZDc3ZWJkMzVkNzBjZDc0ZjA3ZTRlNmEzZmNiY2ExYWYxMzQ5MGRlNTMsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXhORFEzTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default {
components: {
Spreadsheet,
Worksheet,
},
data() {
// Worksheet data
const data = [
[
"Base",
"Exponent",
"Result"
],
[
2,
3,
"=POW(A2,B2)"
],
[
5,
2,
"=POW(A3,B3)"
],
[
10,
4,
"=POW(A4,B4)"
]
]
return {
data
};
}
}
</script>
import { Component, ViewChild, ElementRef } from "@angular/core";
import jspreadsheet from "jspreadsheet";
import * as formula from "@jspreadsheet/formula-pro";
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('OTFlZDRiMTljYmE4ZGJjZDdiNTg2YjQwYjg3MmM5ODkzMzAyODc3ZGE5ZWE0NWVhODc4M2JhNmMzOTExMmUzMzc2NDU5MzUxYjk2N2FjNjRkYzE1NDc0ZDc3ZWJkMzVkNzBjZDc0ZjA3ZTRlNmEzZmNiY2ExYWYxMzQ5MGRlNTMsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXhORFEzTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
@Component({
standalone: true,
selector: "app-root",
template: `<div #spreadsheet></div>`
})
export class AppComponent {
@ViewChild("spreadsheet") spreadsheet: ElementRef;
// Worksheets
worksheets: jspreadsheet.worksheetInstance[];
// Create a new data grid
ngAfterViewInit() {
// Create spreadsheet
this.worksheets = jspreadsheet(this.spreadsheet.nativeElement, {
worksheets: [{
data: [
[
"Base",
"Exponent",
"Result"
],
[
2,
3,
"=POW(A2,B2)"
],
[
5,
2,
"=POW(A3,B3)"
],
[
10,
4,
"=POW(A4,B4)"
]
]
}]
});
}
}