SQRTPI function
PRO BASIC
The SQRTPI function in Jspreadsheet Formulas Pro is a mathematical tool that gives you the positive square root of a number after it has been multiplied by pi (π). Simply put, you input a number into the function and it will perform the calculation for you. This can be very useful in various fields including maths and physics where such calculations are frequently needed. It's designed to be straightforward and easy to use, even for beginners.
Documentation
Returns the positive square root of a number multiplied by pi (π).
Category
Math and trigonometry
Syntax
SQRTPI(x)
| Parameter | Description |
|---|---|
x |
The number to be multiplied by pi (π) before calculating its positive square root. Must be non-negative. |
Behavior
The SQRTPI function calculates the square root of a number multiplied by pi. This function takes one argument, which should be a non-negative number. Here is how it behaves with different types of values:
- Empty cells: If the cell reference is empty,
SQRTPItreats it as 0. - Text: If the cell reference is text,
SQRTPIreturns a#VALUE!error. - Booleans: If the cell reference is a boolean,
SQRTPItreatsTRUEas 1 andFALSEas 0. - Errors: If the cell reference contains an error,
SQRTPIpropagates that error. - Negative numbers: If the argument is a negative number,
SQRTPIreturns a#NUM!error since the square root of a negative number is undefined.
Common Errors
| Error | Description |
|---|---|
#VALUE! |
This error is returned if the input is text or any non-numeric value. |
#NUM! |
This error is returned if the input is a negative number. |
Best practices
- Always ensure that the argument you provide to the
SQRTPIfunction is a non-negative number to avoid#NUM!errors.- Avoid referencing cells that could contain text or non-numeric values, as these will result in
#VALUE!errors.- Since
SQRTPItreats empty cells andFALSEas 0, andTRUEas 1, ensure your cells contain the correct data types to avoid inaccurate calculations.- Use error handling functions like
IFERRORorISNUMBERto handle potential errors in a user-friendly way.
Usage
A few examples using the SQRTPI function.
SQRTPI(9) → 5.31736 (equivalent to √(9 × π))
SQRTPI(2) → 2.50663 (equivalent to √(2 × π))
SQRTPI(0) → 0
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('OWJkNzAzNjM4NGZiMTQzMDA0NTA3MGY2MDdlNzk2NTg0YzhiMzhmMjY1MjE2NTZiZDU1YzMyMjE1YzJkMGE2ZGUwMzY0Y2QzZGQwOWFlNTA1NjQ5YTM0NWE4ZDA4ZTE2MTJkNDQ3NTg3ZjYyNTEwZTA5MmMyMTAyZGNhODIwZTEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpZeU1qRTVNRFl4TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0ltTm9ZWEowY3lJc0ltWnZjbTF6SWl3aVptOXliWFZzWVNJc0luQmhjbk5sY2lJc0luSmxibVJsY2lJc0ltTnZiVzFsYm5Seklpd2lhVzF3YjNKMFpYSWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0lzSW5CeWFXNTBJaXdpYzJobFpYUnpJaXdpWTJ4cFpXNTBJaXdpYzJWeWRtVnlJaXdpYzJoaGNHVnpJaXdpWm05eWJXRjBJbDBzSW1SbGJXOGlPblJ5ZFdWOQ==');
// Set the extensions
jspreadsheet.setExtensions({ formula });
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
[
"Number",
"SQRTPI Result"
],
[
1,
"=SQRTPI(A2)"
],
[
4,
"=SQRTPI(A3)"
],
[
9,
"=SQRTPI(A4)"
],
[
16,
"=SQRTPI(A5)"
]
]
}]
});
</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('OWJkNzAzNjM4NGZiMTQzMDA0NTA3MGY2MDdlNzk2NTg0YzhiMzhmMjY1MjE2NTZiZDU1YzMyMjE1YzJkMGE2ZGUwMzY0Y2QzZGQwOWFlNTA1NjQ5YTM0NWE4ZDA4ZTE2MTJkNDQ3NTg3ZjYyNTEwZTA5MmMyMTAyZGNhODIwZTEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpZeU1qRTVNRFl4TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0ltTm9ZWEowY3lJc0ltWnZjbTF6SWl3aVptOXliWFZzWVNJc0luQmhjbk5sY2lJc0luSmxibVJsY2lJc0ltTnZiVzFsYm5Seklpd2lhVzF3YjNKMFpYSWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0lzSW5CeWFXNTBJaXdpYzJobFpYUnpJaXdpWTJ4cFpXNTBJaXdpYzJWeWRtVnlJaXdpYzJoaGNHVnpJaXdpWm05eWJXRjBJbDBzSW1SbGJXOGlPblJ5ZFdWOQ==');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default function App() {
// Spreadsheet array of worksheets
const spreadsheet = useRef();
// Worksheet data
const data = [
[
"Number",
"SQRTPI Result"
],
[
1,
"=SQRTPI(A2)"
],
[
4,
"=SQRTPI(A3)"
],
[
9,
"=SQRTPI(A4)"
],
[
16,
"=SQRTPI(A5)"
]
];
// 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('OWJkNzAzNjM4NGZiMTQzMDA0NTA3MGY2MDdlNzk2NTg0YzhiMzhmMjY1MjE2NTZiZDU1YzMyMjE1YzJkMGE2ZGUwMzY0Y2QzZGQwOWFlNTA1NjQ5YTM0NWE4ZDA4ZTE2MTJkNDQ3NTg3ZjYyNTEwZTA5MmMyMTAyZGNhODIwZTEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpZeU1qRTVNRFl4TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0ltTm9ZWEowY3lJc0ltWnZjbTF6SWl3aVptOXliWFZzWVNJc0luQmhjbk5sY2lJc0luSmxibVJsY2lJc0ltTnZiVzFsYm5Seklpd2lhVzF3YjNKMFpYSWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0lzSW5CeWFXNTBJaXdpYzJobFpYUnpJaXdpWTJ4cFpXNTBJaXdpYzJWeWRtVnlJaXdpYzJoaGNHVnpJaXdpWm05eWJXRjBJbDBzSW1SbGJXOGlPblJ5ZFdWOQ==');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default {
components: {
Spreadsheet,
Worksheet,
},
data() {
// Worksheet data
const data = [
[
"Number",
"SQRTPI Result"
],
[
1,
"=SQRTPI(A2)"
],
[
4,
"=SQRTPI(A3)"
],
[
9,
"=SQRTPI(A4)"
],
[
16,
"=SQRTPI(A5)"
]
]
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('OWJkNzAzNjM4NGZiMTQzMDA0NTA3MGY2MDdlNzk2NTg0YzhiMzhmMjY1MjE2NTZiZDU1YzMyMjE1YzJkMGE2ZGUwMzY0Y2QzZGQwOWFlNTA1NjQ5YTM0NWE4ZDA4ZTE2MTJkNDQ3NTg3ZjYyNTEwZTA5MmMyMTAyZGNhODIwZTEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpZeU1qRTVNRFl4TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0ltTm9ZWEowY3lJc0ltWnZjbTF6SWl3aVptOXliWFZzWVNJc0luQmhjbk5sY2lJc0luSmxibVJsY2lJc0ltTnZiVzFsYm5Seklpd2lhVzF3YjNKMFpYSWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0lzSW5CeWFXNTBJaXdpYzJobFpYUnpJaXdpWTJ4cFpXNTBJaXdpYzJWeWRtVnlJaXdpYzJoaGNHVnpJaXdpWm05eWJXRjBJbDBzSW1SbGJXOGlPblJ5ZFdWOQ==');
// 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: [
[
"Number",
"SQRTPI Result"
],
[
1,
"=SQRTPI(A2)"
],
[
4,
"=SQRTPI(A3)"
],
[
9,
"=SQRTPI(A4)"
],
[
16,
"=SQRTPI(A5)"
]
]
}]
});
}
}