IMDIV function
PRO
BASIC
In Jspreadsheet Formulas Pro, the IMDIV
function is used to calculate the division result of two complex numbers. You provide two complex numbers as inputs, and the function will return the quotient. It's a handy tool when you're working with complex number calculations, allowing you to quickly and accurately determine the outcomes.
Documentation
Returns the quotient of two complex numbers.
Category
Engineering
Syntax
IMDIV(inumber1, inumber2)
Parameter | Description |
---|---|
inumber1 |
The complex number that you want to divide. |
inumber2 |
The complex number that you want to divide by. |
Behavior
The IMDIV
function is used to divide two complex numbers. It takes two arguments: the dividend and the divisor, which are the complex numbers to be divided. Here is how it handles various inputs:
- Empty cells: If one or both the cells are empty, the function returns a
#NUM!
error. - Text: If the input includes text that cannot be interpreted as a valid complex number, the
IMDIV
function returns a#VALUE!
error. - Booleans: Boolean values are not supported by the
IMDIV
function. It returns a#VALUE!
error for Boolean inputs. - Errors: If one or both the arguments have error values (e.g.,
#N/A
,#VALUE!
,#DIV/0!
, etc.), theIMDIV
function propagates the error. - Numeric values: Numeric values are treated as complex numbers with an imaginary part of 0. For example,
IMDIV(5, 2)
returns 2.5.
Common Errors
Error | Description |
---|---|
#NUM! |
This error occurs if the divisor (second argument) is 0 or 0+0i, or if one or both of the arguments are empty. |
#VALUE! |
This error is returned when one or both the function arguments cannot be interpreted as valid complex numbers, or if Boolean values are used as inputs. |
Best practices
- Always ensure to input valid complex numbers as arguments to avoid the
#VALUE!
error.- Avoid leaving cells empty that are used as arguments in the
IMDIV
function to prevent the#NUM!
error.- Be cautious when using cell references as function arguments, as any change in the referred cells will affect the result of the
IMDIV
function.- Always check that the divisor is not zero to avoid the
#NUM!
error.
Usage
A few examples using the IMDIV function.
IMDIV("4+3i", "1+i") returns 3.5-0.5i
IMDIV("6+2i", "2+2i") returns 2-i
IMDIV("3+5j", "1-2j") returns -1.4+2.2j
IMDIV(5, 2) returns 2.5
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('M2M5N2RhZmYxMjMwY2Y4NDliNTBjNTk3YWRlYTJiMTJhN2FiYWYzODRkM2ZiOGYwOTU4N2NhNDBkZGM1NzlkZTI0ZGYxMTM4ODdhYjY2YWFhYjhhNjhiODAyZDQzMWNlYjAyZmVkZmQ4ZjM3MTA3NzQ0NTMzZmYwYjEzZmU0MGEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdOVEU0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
[
"Complex Number 1",
"Complex Number 2",
"Division Result"
],
[
"4+3i",
"1+i",
"=IMDIV(A2,B2)"
],
[
"6+2i",
"2+2i",
"=IMDIV(A3,B3)"
],
[
"8-4i",
"2+i",
"=IMDIV(A4,B4)"
],
[
"10+5i",
"3-2i",
"=IMDIV(A5,B5)"
]
]
}]
});
</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('M2M5N2RhZmYxMjMwY2Y4NDliNTBjNTk3YWRlYTJiMTJhN2FiYWYzODRkM2ZiOGYwOTU4N2NhNDBkZGM1NzlkZTI0ZGYxMTM4ODdhYjY2YWFhYjhhNjhiODAyZDQzMWNlYjAyZmVkZmQ4ZjM3MTA3NzQ0NTMzZmYwYjEzZmU0MGEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdOVEU0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default function App() {
// Spreadsheet array of worksheets
const spreadsheet = useRef();
// Worksheet data
const data = [
[
"Complex Number 1",
"Complex Number 2",
"Division Result"
],
[
"4+3i",
"1+i",
"=IMDIV(A2,B2)"
],
[
"6+2i",
"2+2i",
"=IMDIV(A3,B3)"
],
[
"8-4i",
"2+i",
"=IMDIV(A4,B4)"
],
[
"10+5i",
"3-2i",
"=IMDIV(A5,B5)"
]
];
// 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('M2M5N2RhZmYxMjMwY2Y4NDliNTBjNTk3YWRlYTJiMTJhN2FiYWYzODRkM2ZiOGYwOTU4N2NhNDBkZGM1NzlkZTI0ZGYxMTM4ODdhYjY2YWFhYjhhNjhiODAyZDQzMWNlYjAyZmVkZmQ4ZjM3MTA3NzQ0NTMzZmYwYjEzZmU0MGEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdOVEU0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default {
components: {
Spreadsheet,
Worksheet,
},
data() {
// Worksheet data
const data = [
[
"Complex Number 1",
"Complex Number 2",
"Division Result"
],
[
"4+3i",
"1+i",
"=IMDIV(A2,B2)"
],
[
"6+2i",
"2+2i",
"=IMDIV(A3,B3)"
],
[
"8-4i",
"2+i",
"=IMDIV(A4,B4)"
],
[
"10+5i",
"3-2i",
"=IMDIV(A5,B5)"
]
]
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('M2M5N2RhZmYxMjMwY2Y4NDliNTBjNTk3YWRlYTJiMTJhN2FiYWYzODRkM2ZiOGYwOTU4N2NhNDBkZGM1NzlkZTI0ZGYxMTM4ODdhYjY2YWFhYjhhNjhiODAyZDQzMWNlYjAyZmVkZmQ4ZjM3MTA3NzQ0NTMzZmYwYjEzZmU0MGEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdOVEU0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// 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: [
[
"Complex Number 1",
"Complex Number 2",
"Division Result"
],
[
"4+3i",
"1+i",
"=IMDIV(A2,B2)"
],
[
"6+2i",
"2+2i",
"=IMDIV(A3,B3)"
],
[
"8-4i",
"2+i",
"=IMDIV(A4,B4)"
],
[
"10+5i",
"3-2i",
"=IMDIV(A5,B5)"
]
]
}]
});
}
}