import 'bootstrap.css';
import '@mescius/wijmo.styles/wijmo.css';
import './styles.css';
import * as wjGrid from '@mescius/wijmo.grid';
import * as wjFlexSheet from '@mescius/wijmo.grid.sheet';
//
document.readyState === 'complete' ? init() : window.onload = init;
//
function init() {
let formulaSheet = new wjFlexSheet.FlexSheet('#formulaSheet');
formulaSheet.addUnboundSheet('基本的な演算子', 35, 8);
formulaSheet.addUnboundSheet('数学', 90, 8);
formulaSheet.addUnboundSheet('論理', 30, 8);
formulaSheet.addUnboundSheet('テキスト', 80, 8);
formulaSheet.addUnboundSheet('集計', 170, 8);
formulaSheet.addUnboundSheet('日付', 60, 9);
formulaSheet.addUnboundSheet('探索と参照', 55, 10);
formulaSheet.addUnboundSheet('財務', 20, 8);
formulaSheet.addUnboundSheet('合計', 20, 8);
formulaSheet.selectionChanged.addHandler((sender, args) => {
let selection = args.range;
if (selection.isValid) {
let cellContent = document.querySelector('#cellContent');
cellContent.textContent = formulaSheet.getCellData(selection.row, selection.col, true);
}
});
formulaSheet.deferUpdate(() => {
for (let i = 0; i < formulaSheet.sheets.length; i++) {
formulaSheet.sheets.selectedIndex = i;
switch (formulaSheet.sheets[i].name) {
case '基本的な演算子':
generateBasicOperatorsSheet(formulaSheet);
break;
case '数学':
generateMathSheet(formulaSheet);
break;
case '論理':
generateLogicalSheet(formulaSheet);
break;
case 'テキスト':
generateTextSheet(formulaSheet);
break;
case '集計':
generateAggregateSheet(formulaSheet);
break;
case '日付':
generateDateSheet(formulaSheet);
break;
case '探索と参照':
generateLookupReferenceSheet(formulaSheet);
break;
case '財務':
generateFinancialSheet(formulaSheet);
break;
case '合計':
generateSummraySheet(formulaSheet);
break;
}
}
formulaSheet.selectedSheetIndex = 0;
});
function generateBasicOperatorsSheet(flexSheet) {
flexSheet.setCellData(0, 1, "1. 正/負の数");
flexSheet.setCellData(1, 1, "正/負の数を入力します。");
flexSheet.setCellData(2, 1, "サンプル:");
flexSheet.setCellData(2, 2, "-1");
flexSheet.setCellData(2, 3, "結果:");
flexSheet.setCellData(2, 4, "=-1");
flexSheet.setCellData(4, 1, "2. 加算/減算演算子");
flexSheet.setCellData(5, 1, "加算/減算演算子を計算します。");
flexSheet.setCellData(6, 1, "サンプル:");
flexSheet.setCellData(6, 2, "1.25 + 2.17");
flexSheet.setCellData(6, 3, "結果:");
flexSheet.setCellData(6, 4, "=1.25 + 2.17");
flexSheet.setCellData(7, 1, "サンプル:");
flexSheet.setCellData(7, 2, "2.23 - 3.51");
flexSheet.setCellData(7, 3, "結果:");
flexSheet.setCellData(7, 4, "=2.23 - 3.51");
flexSheet.setCellData(9, 1, "3. 乗算/除算演算子");
flexSheet.setCellData(10, 1, "乗算/除算演算子を計算します。");
flexSheet.setCellData(11, 1, "サンプル:");
flexSheet.setCellData(11, 2, "12 * 17");
flexSheet.setCellData(11, 3, "結果:");
flexSheet.setCellData(11, 4, "=12 * 17");
flexSheet.setCellData(12, 1, "サンプル:");
flexSheet.setCellData(12, 2, "20 / 6");
flexSheet.setCellData(12, 3, "結果:");
flexSheet.setCellData(12, 4, "=20 / 6");
flexSheet.setCellData(14, 1, "4. 累乗演算子");
flexSheet.setCellData(15, 1, "累乗演算子を計算します。");
flexSheet.setCellData(16, 1, "サンプル:");
flexSheet.setCellData(16, 2, "2^3");
flexSheet.setCellData(16, 3, "結果:");
flexSheet.setCellData(16, 4, "=2^3");
flexSheet.setCellData(18, 1, "5. 括弧");
flexSheet.setCellData(19, 1, "括弧で計算の優先順位を示します。");
flexSheet.setCellData(20, 1, "サンプル:");
flexSheet.setCellData(20, 2, "((1+2)*3)/((4-2)*2)");
flexSheet.setCellData(21, 1, "結果:");
flexSheet.setCellData(21, 2, "=((1+2)*3)/((4-2)*2)");
flexSheet.setCellData(23, 1, "6. パーセント");
flexSheet.setCellData(24, 1, "パーセントを小数値に解析します。");
flexSheet.setCellData(25, 1, "サンプル:");
flexSheet.setCellData(25, 2, "23%");
flexSheet.setCellData(25, 3, "結果:");
flexSheet.setCellData(25, 4, "=23%");
flexSheet.setCellData(27, 1, "7. 指数表記");
flexSheet.setCellData(28, 1, "指数表記の数を小数値に解析します。");
flexSheet.setCellData(29, 1, "サンプル:");
flexSheet.setCellData(29, 2, "1.2556e2");
flexSheet.setCellData(29, 3, "結果:");
flexSheet.setCellData(29, 4, "=1.2556e2");
flexSheet.setCellData(31, 1, "8. テキストの結合");
flexSheet.setCellData(32, 1, "2つの文字列を1つの文字列に結合します。");
flexSheet.setCellData(33, 1, "サンプル:");
flexSheet.setCellData(33, 2, "\"Hello \" & \"World\"");
flexSheet.setCellData(33, 3, "結果:");
flexSheet.setCellData(33, 4, "=\"Hello \" & \"World\"");
flexSheet.applyCellsStyle({
fontWeight: 'bold'
}, [new wjGrid.CellRange(0, 1, 0, 2),
new wjGrid.CellRange(4, 1, 4, 2),
new wjGrid.CellRange(9, 1, 9, 2),
new wjGrid.CellRange(14, 1, 14, 2),
new wjGrid.CellRange(18, 1, 18, 2),
new wjGrid.CellRange(23, 1, 23, 2),
new wjGrid.CellRange(27, 1, 27, 2),
new wjGrid.CellRange(31, 1, 31, 2)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(2, 1, 2, 1), new wjGrid.CellRange(2, 3, 2, 3),
new wjGrid.CellRange(6, 1, 7, 1), new wjGrid.CellRange(6, 3, 7, 3),
new wjGrid.CellRange(11, 1, 12, 1), new wjGrid.CellRange(11, 3, 12, 3),
new wjGrid.CellRange(16, 1, 16, 1), new wjGrid.CellRange(16, 3, 16, 3),
new wjGrid.CellRange(20, 1, 21, 1),
new wjGrid.CellRange(25, 1, 25, 1), new wjGrid.CellRange(25, 3, 25, 3),
new wjGrid.CellRange(29, 1, 29, 1), new wjGrid.CellRange(29, 3, 29, 3),
new wjGrid.CellRange(33, 1, 33, 1), new wjGrid.CellRange(33, 3, 33, 3)]);
flexSheet.mergeRange(new wjGrid.CellRange(0, 1, 0, 2));
flexSheet.mergeRange(new wjGrid.CellRange(1, 1, 1, 2));
flexSheet.mergeRange(new wjGrid.CellRange(4, 1, 4, 2));
flexSheet.mergeRange(new wjGrid.CellRange(5, 1, 5, 2));
flexSheet.mergeRange(new wjGrid.CellRange(9, 1, 9, 3));
flexSheet.mergeRange(new wjGrid.CellRange(10, 1, 10, 2));
flexSheet.mergeRange(new wjGrid.CellRange(14, 1, 14, 2));
flexSheet.mergeRange(new wjGrid.CellRange(15, 1, 15, 2));
flexSheet.mergeRange(new wjGrid.CellRange(19, 1, 19, 3));
flexSheet.mergeRange(new wjGrid.CellRange(20, 2, 20, 3));
flexSheet.mergeRange(new wjGrid.CellRange(23, 1, 23, 2));
flexSheet.mergeRange(new wjGrid.CellRange(24, 1, 24, 3));
flexSheet.mergeRange(new wjGrid.CellRange(27, 1, 27, 2));
flexSheet.mergeRange(new wjGrid.CellRange(28, 1, 28, 3));
flexSheet.mergeRange(new wjGrid.CellRange(31, 1, 31, 2));
flexSheet.mergeRange(new wjGrid.CellRange(32, 1, 32, 3));
}
function generateMathSheet(flexSheet) {
flexSheet.setCellData(0, 1, "1. Pi");
flexSheet.setCellData(1, 1, "πの値を返します。");
flexSheet.setCellData(2, 1, "サンプル:");
flexSheet.setCellData(2, 2, "pi()");
flexSheet.setCellData(2, 3, "結果:");
flexSheet.setCellData(2, 4, "=pi()");
flexSheet.setCellData(4, 1, "2. Rand");
flexSheet.setCellData(5, 1, "0~1の間の乱数を返します。");
flexSheet.setCellData(6, 1, "サンプル:");
flexSheet.setCellData(6, 2, "rand()");
flexSheet.setCellData(6, 3, "結果:");
flexSheet.setCellData(6, 4, "=rand()");
flexSheet.setCellData(8, 1, "3. Abs");
flexSheet.setCellData(9, 1, "数値の絶対値を返します。");
flexSheet.setCellData(10, 1, "サンプル:");
flexSheet.setCellData(10, 2, "abs(-2.73)");
flexSheet.setCellData(10, 3, "結果:");
flexSheet.setCellData(10, 4, "=abs(-2.73)");
flexSheet.setCellData(12, 1, "4. Acos");
flexSheet.setCellData(13, 1, "数値の逆余弦を返します。");
flexSheet.setCellData(14, 1, "サンプル:");
flexSheet.setCellData(14, 2, "acos(0.35)");
flexSheet.setCellData(14, 3, "結果:");
flexSheet.setCellData(14, 4, "=acos(0.35)");
flexSheet.setCellData(16, 1, "5. Asin");
flexSheet.setCellData(17, 1, "数値の逆正弦を返します。");
flexSheet.setCellData(18, 1, "サンプル:");
flexSheet.setCellData(18, 2, "asin(0.5)");
flexSheet.setCellData(18, 3, "結果:");
flexSheet.setCellData(18, 4, "=asin(0.5)");
flexSheet.setCellData(20, 1, "6. Atan");
flexSheet.setCellData(21, 1, "数値の逆正接を返します。");
flexSheet.setCellData(22, 1, "サンプル:");
flexSheet.setCellData(22, 2, "atan(0.67)");
flexSheet.setCellData(22, 3, "結果:");
flexSheet.setCellData(22, 4, "=atan(0.67)");
flexSheet.setCellData(24, 1, "7. Cos");
flexSheet.setCellData(25, 1, "数値の余弦を返します。");
flexSheet.setCellData(26, 1, "サンプル:");
flexSheet.setCellData(26, 2, "cos(0.6)");
flexSheet.setCellData(26, 3, "結果:");
flexSheet.setCellData(26, 4, "=cos(0.6)");
flexSheet.setCellData(28, 1, "8. Sin");
flexSheet.setCellData(29, 1, "指定された角度の正弦を返します。");
flexSheet.setCellData(30, 1, "サンプル:");
flexSheet.setCellData(30, 2, "sin(0.5)");
flexSheet.setCellData(30, 3, "結果:");
flexSheet.setCellData(30, 4, "=sin(0.5)");
flexSheet.setCellData(32, 1, "9. Tan");
flexSheet.setCellData(33, 1, "数値の正接を返します。");
flexSheet.setCellData(34, 1, "サンプル:");
flexSheet.setCellData(34, 2, "tan(0.75)");
flexSheet.setCellData(34, 3, "結果:");
flexSheet.setCellData(34, 4, "=tan(0.75)");
flexSheet.setCellData(36, 1, "10. Atan2");
flexSheet.setCellData(37, 1, "XおよびY座標から逆正接を返します。");
flexSheet.setCellData(38, 1, "サンプル:");
flexSheet.setCellData(38, 2, "atan2(90, 15)");
flexSheet.setCellData(38, 3, "結果:");
flexSheet.setCellData(38, 4, "=atan2(90, 15)");
flexSheet.setCellData(40, 1, "11. Ceiling");
flexSheet.setCellData(41, 1, "数値を最も近い整数または最も近い基準値の倍数に切り上げます。");
flexSheet.setCellData(42, 1, "サンプル:");
flexSheet.setCellData(42, 2, "ceiling(6.03)");
flexSheet.setCellData(42, 3, "結果:");
flexSheet.setCellData(42, 4, "=ceiling(6.03)");
flexSheet.setCellData(44, 1, "12. Floor");
flexSheet.setCellData(45, 1, "数値を0に近い方に切り捨てます。");
flexSheet.setCellData(46, 1, "サンプル:");
flexSheet.setCellData(46, 2, "floor(7.96)");
flexSheet.setCellData(46, 3, "結果:");
flexSheet.setCellData(46, 4, "=floor(7.96)");
flexSheet.setCellData(48, 1, "13. Round");
flexSheet.setCellData(49, 1, "数値を指定された桁数に丸めます。");
flexSheet.setCellData(50, 1, "サンプル:");
flexSheet.setCellData(50, 2, "round(7.56, 1)");
flexSheet.setCellData(50, 3, "結果:");
flexSheet.setCellData(50, 4, "=round(7.56, 1)");
flexSheet.setCellData(51, 1, "サンプル:");
flexSheet.setCellData(51, 2, "round(7.54, 1)");
flexSheet.setCellData(51, 3, "結果:");
flexSheet.setCellData(51, 4, "=round(7.54, 1)");
flexSheet.setCellData(53, 1, "14. Exp");
flexSheet.setCellData(54, 1, "eを底とする数値のべき乗を返します。");
flexSheet.setCellData(55, 1, "サンプル:");
flexSheet.setCellData(55, 2, "exp(-1)");
flexSheet.setCellData(55, 3, "結果:");
flexSheet.setCellData(55, 4, "=exp(-1)");
flexSheet.setCellData(57, 1, "15. Ln");
flexSheet.setCellData(58, 1, "数値の自然対数を返します。");
flexSheet.setCellData(59, 1, "サンプル:");
flexSheet.setCellData(59, 2, "ln(15)");
flexSheet.setCellData(59, 3, "結果:");
flexSheet.setCellData(59, 4, "=ln(15)");
flexSheet.setCellData(61, 1, "16. Sqrt");
flexSheet.setCellData(62, 1, "正の平方根を返します。");
flexSheet.setCellData(63, 1, "サンプル:");
flexSheet.setCellData(63, 2, "sqrt(16)");
flexSheet.setCellData(63, 3, "結果:");
flexSheet.setCellData(63, 4, "=sqrt(16)");
flexSheet.setCellData(65, 1, "17. Power");
flexSheet.setCellData(66, 1, "数値のべき乗を返します。");
flexSheet.setCellData(67, 1, "サンプル:");
flexSheet.setCellData(67, 2, "power(1.5, 0.5)");
flexSheet.setCellData(67, 3, "結果:");
flexSheet.setCellData(67, 4, "=power(1.5, 0.5)");
flexSheet.setCellData(69, 1, "18. Mod");
flexSheet.setCellData(70, 1, "剰余を返します。");
flexSheet.setCellData(71, 1, "サンプル:");
flexSheet.setCellData(71, 2, "mod(11, 3)");
flexSheet.setCellData(71, 3, "結果:");
flexSheet.setCellData(71, 4, "=mod(11, 3)");
flexSheet.setCellData(73, 1, "19. Rounddown");
flexSheet.setCellData(74, 1, "数値を0に近い方に切り捨てます。");
flexSheet.setCellData(75, 1, "サンプル:");
flexSheet.setCellData(75, 2, "rounddown(11.987, 2)");
flexSheet.setCellData(76, 1, "結果:");
flexSheet.setCellData(76, 2, "=rounddown(11.987, 2)");
flexSheet.setCellData(78, 1, "20. Roundup");
flexSheet.setCellData(79, 1, "数値を0から遠い方に切り上げます。");
flexSheet.setCellData(80, 1, "サンプル:");
flexSheet.setCellData(80, 2, "roundup(11.982, 2)");
flexSheet.setCellData(81, 1, "結果:");
flexSheet.setCellData(81, 2, "=roundup(11.982, 2)");
flexSheet.setCellData(83, 1, "21. Trunc");
flexSheet.setCellData(84, 1, "数値を整数に切り捨てます。");
flexSheet.setCellData(85, 1, "サンプル:");
flexSheet.setCellData(85, 2, "trunc(8.9)");
flexSheet.setCellData(85, 3, "結果:");
flexSheet.setCellData(85, 4, "=trunc(8.9)");
flexSheet.applyCellsStyle({
fontWeight: 'bold'
}, [new wjGrid.CellRange(0, 1, 0, 1),
new wjGrid.CellRange(4, 1, 4, 1),
new wjGrid.CellRange(8, 1, 8, 1),
new wjGrid.CellRange(12, 1, 12, 1),
new wjGrid.CellRange(16, 1, 16, 1),
new wjGrid.CellRange(20, 1, 20, 1),
new wjGrid.CellRange(24, 1, 24, 1),
new wjGrid.CellRange(28, 1, 28, 1),
new wjGrid.CellRange(32, 1, 32, 1),
new wjGrid.CellRange(36, 1, 36, 1),
new wjGrid.CellRange(40, 1, 40, 1),
new wjGrid.CellRange(44, 1, 44, 1),
new wjGrid.CellRange(48, 1, 48, 1),
new wjGrid.CellRange(53, 1, 53, 1),
new wjGrid.CellRange(57, 1, 57, 1),
new wjGrid.CellRange(61, 1, 61, 1),
new wjGrid.CellRange(65, 1, 65, 1),
new wjGrid.CellRange(69, 1, 69, 1),
new wjGrid.CellRange(73, 1, 73, 1),
new wjGrid.CellRange(78, 1, 78, 1),
new wjGrid.CellRange(83, 1, 83, 1)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(2, 1, 2, 1), new wjGrid.CellRange(2, 3, 2, 3),
new wjGrid.CellRange(6, 1, 6, 1), new wjGrid.CellRange(6, 3, 6, 3),
new wjGrid.CellRange(10, 1, 10, 1), new wjGrid.CellRange(10, 3, 10, 3),
new wjGrid.CellRange(14, 1, 14, 1), new wjGrid.CellRange(14, 3, 14, 3),
new wjGrid.CellRange(18, 1, 18, 1), new wjGrid.CellRange(18, 3, 18, 3),
new wjGrid.CellRange(22, 1, 22, 1), new wjGrid.CellRange(22, 3, 22, 3),
new wjGrid.CellRange(26, 1, 26, 1), new wjGrid.CellRange(26, 3, 26, 3),
new wjGrid.CellRange(30, 1, 30, 1), new wjGrid.CellRange(30, 3, 30, 3),
new wjGrid.CellRange(34, 1, 34, 1), new wjGrid.CellRange(34, 3, 34, 3),
new wjGrid.CellRange(38, 1, 38, 1), new wjGrid.CellRange(38, 3, 38, 3),
new wjGrid.CellRange(42, 1, 42, 1), new wjGrid.CellRange(42, 3, 42, 3),
new wjGrid.CellRange(46, 1, 47, 1), new wjGrid.CellRange(46, 3, 47, 3),
new wjGrid.CellRange(50, 1, 51, 1), new wjGrid.CellRange(50, 3, 51, 3),
new wjGrid.CellRange(55, 1, 55, 1), new wjGrid.CellRange(55, 3, 55, 3),
new wjGrid.CellRange(59, 1, 59, 1), new wjGrid.CellRange(59, 3, 59, 3),
new wjGrid.CellRange(63, 1, 63, 1), new wjGrid.CellRange(63, 3, 63, 3),
new wjGrid.CellRange(67, 1, 67, 1), new wjGrid.CellRange(67, 3, 67, 3),
new wjGrid.CellRange(71, 1, 71, 1), new wjGrid.CellRange(71, 3, 71, 3),
new wjGrid.CellRange(75, 1, 76, 1),
new wjGrid.CellRange(80, 1, 81, 1),
new wjGrid.CellRange(85, 1, 85, 1), new wjGrid.CellRange(85, 3, 85, 3)]);
flexSheet.mergeRange(new wjGrid.CellRange(1, 1, 1, 2));
flexSheet.mergeRange(new wjGrid.CellRange(5, 1, 5, 3));
flexSheet.mergeRange(new wjGrid.CellRange(9, 1, 9, 3));
flexSheet.mergeRange(new wjGrid.CellRange(13, 1, 13, 3));
flexSheet.mergeRange(new wjGrid.CellRange(17, 1, 17, 2));
flexSheet.mergeRange(new wjGrid.CellRange(21, 1, 21, 3));
flexSheet.mergeRange(new wjGrid.CellRange(25, 1, 25, 2));
flexSheet.mergeRange(new wjGrid.CellRange(29, 1, 29, 3));
flexSheet.mergeRange(new wjGrid.CellRange(33, 1, 33, 2));
flexSheet.mergeRange(new wjGrid.CellRange(37, 1, 37, 3));
flexSheet.mergeRange(new wjGrid.CellRange(41, 1, 41, 5));
flexSheet.mergeRange(new wjGrid.CellRange(45, 1, 45, 3));
flexSheet.mergeRange(new wjGrid.CellRange(49, 1, 49, 3));
flexSheet.mergeRange(new wjGrid.CellRange(54, 1, 54, 3));
flexSheet.mergeRange(new wjGrid.CellRange(58, 1, 58, 3));
flexSheet.mergeRange(new wjGrid.CellRange(62, 1, 62, 2));
flexSheet.mergeRange(new wjGrid.CellRange(66, 1, 66, 3));
flexSheet.mergeRange(new wjGrid.CellRange(70, 1, 70, 3));
flexSheet.mergeRange(new wjGrid.CellRange(73, 1, 73, 2));
flexSheet.mergeRange(new wjGrid.CellRange(74, 1, 74, 3));
flexSheet.mergeRange(new wjGrid.CellRange(75, 2, 75, 3));
flexSheet.mergeRange(new wjGrid.CellRange(79, 1, 79, 3));
flexSheet.mergeRange(new wjGrid.CellRange(80, 2, 80, 3));
flexSheet.mergeRange(new wjGrid.CellRange(84, 1, 84, 2));
}
function generateLogicalSheet(flexSheet) {
flexSheet.setCellData(0, 1, "1. 比較演算子");
flexSheet.setCellData(1, 1, ">、<、>=、<=、=、<>などの比較演算子のブール結果を取得します。");
flexSheet.setCellData(2, 1, "サンプル:");
flexSheet.setCellData(2, 2, "1>2");
flexSheet.setCellData(2, 3, "結果:");
flexSheet.setCellData(2, 4, "=1>2");
flexSheet.setCellData(4, 1, "2. True");
flexSheet.setCellData(5, 1, "論理値TRUEを返します。");
flexSheet.setCellData(6, 1, "サンプル:");
flexSheet.setCellData(6, 2, "true()");
flexSheet.setCellData(6, 3, "結果:");
flexSheet.setCellData(6, 4, "=true()");
flexSheet.setCellData(8, 1, "3. False");
flexSheet.setCellData(9, 1, "論理値FALSEを返します。");
flexSheet.setCellData(10, 1, "サンプル:");
flexSheet.setCellData(10, 2, "false()");
flexSheet.setCellData(10, 3, "結果:");
flexSheet.setCellData(10, 4, "=false()");
flexSheet.setCellData(12, 1, "4. And");
flexSheet.setCellData(13, 1, "引数のすべてがTRUEの場合に、TRUEを返します。");
flexSheet.setCellData(14, 1, "サンプル:");
flexSheet.setCellData(14, 2, "and(true(),1>2)");
flexSheet.setCellData(14, 3, "結果:");
flexSheet.setCellData(14, 4, "=and(true(),1>2)");
flexSheet.setCellData(16, 1, "5. Or");
flexSheet.setCellData(17, 1, "いずれかの引数がTRUEの場合に、TRUEを返します。");
flexSheet.setCellData(18, 1, "サンプル:");
flexSheet.setCellData(18, 2, "or(false(),1<2)");
flexSheet.setCellData(18, 3, "結果:");
flexSheet.setCellData(18, 4, "=or(false(),1<2)");
flexSheet.setCellData(20, 1, "6. Not");
flexSheet.setCellData(21, 1, "引数のロジックを反転させます。");
flexSheet.setCellData(22, 1, "サンプル:");
flexSheet.setCellData(22, 2, "not(1<2)");
flexSheet.setCellData(22, 3, "結果:");
flexSheet.setCellData(22, 4, "=not(1<2)");
flexSheet.setCellData(24, 1, "7. If");
flexSheet.setCellData(25, 1, "論理テストの実行を指定します。");
flexSheet.setCellData(26, 1, "サンプル:");
flexSheet.setCellData(26, 2, "if(true(), \"true result\", \"false result\")");
flexSheet.setCellData(27, 1, "結果:");
flexSheet.setCellData(27, 2, "=if(true(), \"true result\", \"false result\")");
flexSheet.applyCellsStyle({
fontWeight: 'bold'
}, [new wjGrid.CellRange(0, 1, 0, 1),
new wjGrid.CellRange(4, 1, 4, 1),
new wjGrid.CellRange(8, 1, 8, 1),
new wjGrid.CellRange(12, 1, 12, 1),
new wjGrid.CellRange(16, 1, 16, 1),
new wjGrid.CellRange(20, 1, 20, 1),
new wjGrid.CellRange(24, 1, 24, 1)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(2, 1, 2, 1), new wjGrid.CellRange(2, 3, 2, 3),
new wjGrid.CellRange(6, 1, 6, 1), new wjGrid.CellRange(6, 3, 6, 3),
new wjGrid.CellRange(10, 1, 10, 1), new wjGrid.CellRange(10, 3, 10, 3),
new wjGrid.CellRange(14, 1, 14, 1), new wjGrid.CellRange(14, 3, 14, 3),
new wjGrid.CellRange(18, 1, 18, 1), new wjGrid.CellRange(18, 3, 18, 3),
new wjGrid.CellRange(22, 1, 22, 1), new wjGrid.CellRange(22, 3, 22, 3),
new wjGrid.CellRange(26, 1, 27, 1)]);
flexSheet.mergeRange(new wjGrid.CellRange(0, 1, 0, 2));
flexSheet.mergeRange(new wjGrid.CellRange(1, 1, 1, 5));
flexSheet.mergeRange(new wjGrid.CellRange(5, 1, 5, 2));
flexSheet.mergeRange(new wjGrid.CellRange(9, 1, 9, 2));
flexSheet.mergeRange(new wjGrid.CellRange(13, 1, 13, 3));
flexSheet.mergeRange(new wjGrid.CellRange(17, 1, 17, 3));
flexSheet.mergeRange(new wjGrid.CellRange(21, 1, 21, 3));
flexSheet.mergeRange(new wjGrid.CellRange(25, 1, 25, 2));
flexSheet.mergeRange(new wjGrid.CellRange(26, 2, 26, 4));
}
function generateTextSheet(flexSheet) {
flexSheet.setCellData(0, 1, "1. Char");
flexSheet.setCellData(1, 1, "コード番号で指定された文字を返します。");
flexSheet.setCellData(2, 1, "サンプル:");
flexSheet.setCellData(2, 2, "char(65)");
flexSheet.setCellData(2, 3, "結果:");
flexSheet.setCellData(2, 4, "=char(65)");
flexSheet.setCellData(4, 1, "2. Code");
flexSheet.setCellData(5, 1, "テキスト文字列の最初の文字の数値コードを返します。");
flexSheet.setCellData(6, 1, "サンプル:");
flexSheet.setCellData(6, 2, "code(\"a\")");
flexSheet.setCellData(6, 3, "結果:");
flexSheet.setCellData(6, 4, "=code(\"a\")");
flexSheet.setCellData(8, 1, "3. Concatenate");
flexSheet.setCellData(9, 1, "複数のテキスト項目を1つのテキスト項目に結合します。");
flexSheet.setCellData(10, 1, "サンプル:");
flexSheet.setCellData(10, 2, "concatenate(\"Hello \", \"World!\")");
flexSheet.setCellData(11, 1, "結果:");
flexSheet.setCellData(11, 2, "=concatenate(\"Hello \", \"World!\")");
flexSheet.setCellData(13, 1, "4. Left");
flexSheet.setCellData(14, 1, "テキスト値の先頭から指定された数の文字を返します。");
flexSheet.setCellData(15, 1, "サンプル:");
flexSheet.setCellData(15, 2, "left(\"Abcdef\",3)");
flexSheet.setCellData(15, 3, "結果:");
flexSheet.setCellData(15, 4, "=left(\"Abcdef\",3)");
flexSheet.setCellData(17, 1, "5. Right");
flexSheet.setCellData(18, 1, "テキスト値の末尾から指定された数の文字を返します。");
flexSheet.setCellData(19, 1, "サンプル:");
flexSheet.setCellData(19, 2, "right(\"Abcdef\",3)");
flexSheet.setCellData(19, 3, "結果:");
flexSheet.setCellData(19, 4, "=right(\"Abcdef\",3)");
flexSheet.setCellData(21, 1, "6. Mid");
flexSheet.setCellData(22, 1, "テキスト文字列の指定された位置から、指定された数の文字を返します。");
flexSheet.setCellData(23, 1, "サンプル:");
flexSheet.setCellData(23, 2, "mid(\"Abcdef\",3,2)");
flexSheet.setCellData(24, 1, "結果:");
flexSheet.setCellData(24, 2, "=mid(\"Abcdef\",3,2)");
flexSheet.setCellData(26, 1, "7. Len");
flexSheet.setCellData(27, 1, "テキスト文字列の長さ(文字数)を返します。");
flexSheet.setCellData(28, 1, "サンプル:");
flexSheet.setCellData(28, 2, "len(\"Abcdef\")");
flexSheet.setCellData(28, 3, "結果:");
flexSheet.setCellData(28, 4, "=len(\"Abcdef\")");
flexSheet.setCellData(30, 1, "8. Find");
flexSheet.setCellData(31, 1, "テキストから別のテキスト値を検索します(大文字と小文字は区別されます)。");
flexSheet.setCellData(32, 1, "サンプル:");
flexSheet.setCellData(32, 2, "find(\"Bc\",\"ABcdef\")");
flexSheet.setCellData(33, 1, "結果:");
flexSheet.setCellData(33, 2, "=find(\"Bc\",\"ABcdef\")");
flexSheet.setCellData(35, 1, "9. Search");
flexSheet.setCellData(36, 1, "テキストから別のテキスト値を検索します(大文字と小文字は区別されません)。");
flexSheet.setCellData(37, 1, "サンプル:");
flexSheet.setCellData(37, 2, "search(\"bc\",\"ABcdef\")");
flexSheet.setCellData(38, 1, "結果:");
flexSheet.setCellData(38, 2, "=search(\"bc\",\"ABcdef\")");
flexSheet.setCellData(40, 1, "10. Lower");
flexSheet.setCellData(41, 1, "テキストを小文字に変換します。");
flexSheet.setCellData(42, 1, "サンプル:");
flexSheet.setCellData(42, 2, "lower(\"ABCDE\")");
flexSheet.setCellData(42, 3, "結果:");
flexSheet.setCellData(42, 4, "=lower(\"ABCDE\")");
flexSheet.setCellData(44, 1, "11. Upper");
flexSheet.setCellData(45, 1, "テキストを大文字に変換します。");
flexSheet.setCellData(46, 1, "サンプル:");
flexSheet.setCellData(46, 2, "upper(\"abcdef\")");
flexSheet.setCellData(46, 3, "結果:");
flexSheet.setCellData(46, 4, "=upper(\"abcdef\")");
flexSheet.setCellData(48, 1, "12. Proper");
flexSheet.setCellData(49, 1, "テキスト値の各単語の先頭の文字を大文字に変換します。");
flexSheet.setCellData(50, 1, "サンプル:");
flexSheet.setCellData(50, 2, "proper(\"abcde\")");
flexSheet.setCellData(50, 3, "結果:");
flexSheet.setCellData(50, 4, "=proper(\"abcde\")");
flexSheet.setCellData(52, 1, "13. Trim");
flexSheet.setCellData(53, 1, "テキストからスペースを削除します。");
flexSheet.setCellData(54, 1, "サンプル:");
flexSheet.setCellData(54, 2, "trim(\" abcde \")");
flexSheet.setCellData(54, 3, "結果:");
flexSheet.setCellData(54, 4, "=trim(\" abcde \")");
flexSheet.setCellData(56, 1, "14. Replace");
flexSheet.setCellData(57, 1, "テキスト内の文字を置換します。");
flexSheet.setCellData(58, 1, "サンプル:");
flexSheet.setCellData(58, 2, "replace(\"abcdefg\",2,3,\"wxyz\")");
flexSheet.setCellData(59, 1, "結果:");
flexSheet.setCellData(59, 2, "=replace(\"abcdefg\",2,3,\"wxyz\")");
flexSheet.setCellData(61, 1, "15. Substitute");
flexSheet.setCellData(62, 1, "テキスト文字列内の指定されたテキストを新しいテキストに置換します。");
flexSheet.setCellData(63, 1, "サンプル:");
flexSheet.setCellData(63, 2, "substitute(\"abcabcdabcdef\",\"ab\",\"xy\")");
flexSheet.setCellData(64, 1, "結果:");
flexSheet.setCellData(64, 2, "=substitute(\"abcabcdabcdef\",\"ab\",\"xy\")");
flexSheet.setCellData(66, 1, "16. Rept");
flexSheet.setCellData(67, 1, "テキストを指定された回数だけ繰り返します。");
flexSheet.setCellData(68, 1, "サンプル:");
flexSheet.setCellData(68, 2, "rept(\"abc\",3)");
flexSheet.setCellData(68, 3, "結果:");
flexSheet.setCellData(68, 4, "=rept(\"abc\",3)");
flexSheet.setCellData(70, 1, "17. Text");
flexSheet.setCellData(71, 1, "数値を書式設定し、テキストに変換します。");
flexSheet.setCellData(72, 1, "サンプル:");
flexSheet.setCellData(72, 2, "text(1234,\"c2\")");
flexSheet.setCellData(72, 3, "結果:");
flexSheet.setCellData(72, 4, "=text(1234,\"c2\")");
flexSheet.setCellData(74, 1, "18. Value");
flexSheet.setCellData(75, 1, "テキスト引数を数値に変換します。");
flexSheet.setCellData(76, 1, "サンプル:");
flexSheet.setCellData(76, 2, "value(\"1234\")");
flexSheet.setCellData(76, 3, "結果:");
flexSheet.setCellData(76, 4, "=value(\"1234\")");
flexSheet.applyCellsStyle({
fontWeight: 'bold'
}, [new wjGrid.CellRange(0, 1, 0, 1),
new wjGrid.CellRange(4, 1, 4, 1),
new wjGrid.CellRange(8, 1, 8, 1),
new wjGrid.CellRange(13, 1, 13, 1),
new wjGrid.CellRange(17, 1, 17, 1),
new wjGrid.CellRange(21, 1, 21, 1),
new wjGrid.CellRange(26, 1, 26, 1),
new wjGrid.CellRange(30, 1, 30, 1),
new wjGrid.CellRange(35, 1, 35, 1),
new wjGrid.CellRange(40, 1, 40, 1),
new wjGrid.CellRange(44, 1, 44, 1),
new wjGrid.CellRange(48, 1, 48, 1),
new wjGrid.CellRange(52, 1, 52, 1),
new wjGrid.CellRange(56, 1, 56, 1),
new wjGrid.CellRange(61, 1, 61, 1),
new wjGrid.CellRange(66, 1, 66, 1),
new wjGrid.CellRange(70, 1, 70, 1),
new wjGrid.CellRange(74, 1, 74, 1)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(2, 1, 2, 1), new wjGrid.CellRange(2, 3, 2, 3),
new wjGrid.CellRange(6, 1, 6, 1), new wjGrid.CellRange(6, 3, 6, 3),
new wjGrid.CellRange(10, 1, 11, 1),
new wjGrid.CellRange(15, 1, 15, 1), new wjGrid.CellRange(15, 3, 15, 3),
new wjGrid.CellRange(19, 1, 19, 1), new wjGrid.CellRange(19, 3, 19, 3),
new wjGrid.CellRange(23, 1, 24, 1),
new wjGrid.CellRange(28, 1, 28, 1), new wjGrid.CellRange(28, 3, 28, 3),
new wjGrid.CellRange(32, 1, 33, 1),
new wjGrid.CellRange(37, 1, 38, 1),
new wjGrid.CellRange(42, 1, 42, 1), new wjGrid.CellRange(42, 3, 42, 3),
new wjGrid.CellRange(46, 1, 46, 1), new wjGrid.CellRange(46, 3, 46, 3),
new wjGrid.CellRange(50, 1, 50, 1), new wjGrid.CellRange(50, 3, 50, 3),
new wjGrid.CellRange(54, 1, 54, 1), new wjGrid.CellRange(54, 3, 54, 3),
new wjGrid.CellRange(58, 1, 59, 1),
new wjGrid.CellRange(63, 1, 64, 1),
new wjGrid.CellRange(68, 1, 68, 1), new wjGrid.CellRange(68, 3, 68, 3),
new wjGrid.CellRange(72, 1, 72, 1), new wjGrid.CellRange(72, 3, 72, 3),
new wjGrid.CellRange(76, 1, 76, 1), new wjGrid.CellRange(76, 3, 76, 3)]);
flexSheet.mergeRange(new wjGrid.CellRange(1, 1, 1, 4));
flexSheet.mergeRange(new wjGrid.CellRange(5, 1, 5, 4));
flexSheet.mergeRange(new wjGrid.CellRange(8, 1, 8, 2));
flexSheet.mergeRange(new wjGrid.CellRange(9, 1, 9, 3));
flexSheet.mergeRange(new wjGrid.CellRange(10, 2, 10, 3));
flexSheet.mergeRange(new wjGrid.CellRange(14, 1, 14, 3));
flexSheet.mergeRange(new wjGrid.CellRange(18, 1, 18, 3));
flexSheet.mergeRange(new wjGrid.CellRange(22, 1, 22, 6));
flexSheet.mergeRange(new wjGrid.CellRange(23, 2, 23, 3));
flexSheet.mergeRange(new wjGrid.CellRange(27, 1, 27, 3));
flexSheet.mergeRange(new wjGrid.CellRange(31, 1, 31, 3));
flexSheet.mergeRange(new wjGrid.CellRange(32, 2, 32, 3));
flexSheet.mergeRange(new wjGrid.CellRange(36, 1, 36, 4));
flexSheet.mergeRange(new wjGrid.CellRange(37, 2, 37, 3));
flexSheet.mergeRange(new wjGrid.CellRange(41, 1, 41, 2));
flexSheet.mergeRange(new wjGrid.CellRange(45, 1, 45, 2));
flexSheet.mergeRange(new wjGrid.CellRange(49, 1, 49, 4));
flexSheet.mergeRange(new wjGrid.CellRange(53, 1, 53, 2));
flexSheet.mergeRange(new wjGrid.CellRange(57, 1, 57, 2));
flexSheet.mergeRange(new wjGrid.CellRange(58, 2, 58, 3));
flexSheet.mergeRange(new wjGrid.CellRange(61, 1, 61, 2));
flexSheet.mergeRange(new wjGrid.CellRange(62, 1, 62, 3));
flexSheet.mergeRange(new wjGrid.CellRange(63, 2, 63, 4));
flexSheet.mergeRange(new wjGrid.CellRange(67, 1, 67, 3));
flexSheet.mergeRange(new wjGrid.CellRange(71, 1, 71, 3));
flexSheet.mergeRange(new wjGrid.CellRange(75, 1, 75, 3));
}
function generateAggregateSheet(flexSheet) {
let rowIndex, colIndex;
flexSheet.setCellData(0, 1, "サンプルデータ:");
for (rowIndex = 1; rowIndex <= 4; rowIndex++) {
for (colIndex = 1; colIndex <= 7; colIndex++) {
flexSheet.setCellData(rowIndex, colIndex, Math.random() * 200);
}
}
flexSheet.setCellData(6, 1, "Tree");
flexSheet.setCellData(6, 2, "Height");
flexSheet.setCellData(6, 3, "Age");
flexSheet.setCellData(6, 4, "Yield");
flexSheet.setCellData(6, 5, "Profit");
flexSheet.setCellData(6, 6, "Height");
flexSheet.setCellData(7, 1, "Apple");
flexSheet.setCellData(7, 2, ">10");
flexSheet.setCellData(7, 6, "<16");
flexSheet.setCellData(8, 1, "Pear");
flexSheet.setCellData(10, 1, "Tree");
flexSheet.setCellData(10, 2, "Height");
flexSheet.setCellData(10, 3, "Age");
flexSheet.setCellData(10, 4, "Yield");
flexSheet.setCellData(10, 5, "Profit");
for (rowIndex = 11; rowIndex <= 20; rowIndex++) {
for (colIndex = 1; colIndex <= 5; colIndex++) {
if (colIndex === 1) {
if (rowIndex === 13) {
flexSheet.setCellData(rowIndex, colIndex, "Apple");
}
else {
flexSheet.setCellData(rowIndex, colIndex, ["Apple", "Pear", "Cherry", "Orange"][Math.floor(Math.random() * 4)]);
}
}
else if (colIndex === 5) {
flexSheet.setCellData(rowIndex, colIndex, Math.random() * 300);
}
else {
if (rowIndex === 13 && colIndex === 2) {
flexSheet.setCellData(rowIndex, colIndex, 15);
}
else if (rowIndex === 13 && colIndex === 3) {
flexSheet.setCellData(rowIndex, colIndex, "N/A");
}
else {
flexSheet.setCellData(rowIndex, colIndex, Math.round(Math.random() * 20));
}
}
}
}
flexSheet.setCellData(22, 1, "1. Sum");
flexSheet.setCellData(23, 1, "引数を合計します。");
flexSheet.setCellData(24, 1, "サンプル:");
flexSheet.setCellData(24, 2, "sum(B2:D4)");
flexSheet.setCellData(25, 1, "結果:");
flexSheet.setCellData(25, 2, "=sum(B2:D4)");
flexSheet.setCellData(26, 1, "サンプル:");
flexSheet.setCellData(26, 2, "sum(1,3,5,7,10,12,13)");
flexSheet.setCellData(27, 1, "結果:");
flexSheet.setCellData(27, 2, "=sum(1,3,5,7,10,12,13)");
flexSheet.setCellData(29, 1, "2. Average");
flexSheet.setCellData(30, 1, "引数の平均値を返します。");
flexSheet.setCellData(31, 1, "サンプル:");
flexSheet.setCellData(31, 2, "average(C2:E3)");
flexSheet.setCellData(32, 1, "結果:");
flexSheet.setCellData(32, 2, "=average(C2:E3)");
flexSheet.setCellData(33, 1, "サンプル:");
flexSheet.setCellData(33, 2, "average(2,4,5,7,11,13,19)");
flexSheet.setCellData(34, 1, "結果:");
flexSheet.setCellData(34, 2, "=average(2,4,5,7,11,13,19)");
flexSheet.setCellData(36, 1, "3. Count");
flexSheet.setCellData(37, 1, "引数リストに含まれる数値の個数を返します。");
flexSheet.setCellData(38, 1, "サンプル:");
flexSheet.setCellData(38, 2, "count(B3:E4)");
flexSheet.setCellData(39, 1, "結果:");
flexSheet.setCellData(39, 2, "=count(B3:E4)");
flexSheet.setCellData(40, 1, "サンプル:");
flexSheet.setCellData(40, 2, "count(1,7,8,10,11,16,19)");
flexSheet.setCellData(41, 1, "結果:");
flexSheet.setCellData(41, 2, "=count(1,7,8,10,11,16,19)");
flexSheet.setCellData(43, 1, "4. Max");
flexSheet.setCellData(44, 1, "引数リスト内の最大値を返します。");
flexSheet.setCellData(45, 1, "サンプル:");
flexSheet.setCellData(45, 2, "max(C3:F5)");
flexSheet.setCellData(46, 1, "結果:");
flexSheet.setCellData(46, 2, "=max(C3:F5)");
flexSheet.setCellData(47, 1, "サンプル:");
flexSheet.setCellData(47, 2, "max(100,87,103,54,75,34)");
flexSheet.setCellData(48, 1, "結果:");
flexSheet.setCellData(48, 2, "=max(100,87,103,54,75,34)");
flexSheet.setCellData(50, 1, "5. Min");
flexSheet.setCellData(51, 1, "引数リスト内の最小値を返します。");
flexSheet.setCellData(52, 1, "サンプル:");
flexSheet.setCellData(52, 2, "min(B2:G5)");
flexSheet.setCellData(53, 1, "結果:");
flexSheet.setCellData(53, 2, "=min(B2:G5)");
flexSheet.setCellData(54, 1, "サンプル:");
flexSheet.setCellData(54, 2, "min(74,47,68,99,106,13,51)");
flexSheet.setCellData(55, 1, "結果:");
flexSheet.setCellData(55, 2, "=min(74,47,68,99,106,13,51)");
flexSheet.setCellData(57, 1, "6. StDev");
flexSheet.setCellData(58, 1, "標本標準偏差を返します。");
flexSheet.setCellData(59, 1, "サンプル:");
flexSheet.setCellData(59, 2, "stdev(B3:G5)");
flexSheet.setCellData(60, 1, "結果:");
flexSheet.setCellData(60, 2, "=stdev(B3:G5)");
flexSheet.setCellData(61, 1, "サンプル:");
flexSheet.setCellData(61, 2, "stdev(74,47,68,99,106,13,51)");
flexSheet.setCellData(62, 1, "結果:");
flexSheet.setCellData(62, 2, "=stdev(74,47,68,99,106,13,51)");
flexSheet.setCellData(64, 1, "7. StDevP");
flexSheet.setCellData(65, 1, "母集団標準偏差を返します。");
flexSheet.setCellData(66, 1, "サンプル:");
flexSheet.setCellData(66, 2, "stdevp(B3:G5)");
flexSheet.setCellData(67, 1, "結果:");
flexSheet.setCellData(67, 2, "=stdevp(B3:G5)");
flexSheet.setCellData(68, 1, "サンプル:");
flexSheet.setCellData(68, 2, "stdevp(74,47,68,99,106,13,51)");
flexSheet.setCellData(69, 1, "結果:");
flexSheet.setCellData(69, 2, "=stdevp(74,47,68,99,106,13,51)");
flexSheet.setCellData(71, 1, "8. Var");
flexSheet.setCellData(72, 1, "標本分散を返します。");
flexSheet.setCellData(73, 1, "サンプル:");
flexSheet.setCellData(73, 2, "var(C2:H4)");
flexSheet.setCellData(74, 1, "結果:");
flexSheet.setCellData(74, 2, "=var(C2:H4)");
flexSheet.setCellData(75, 1, "サンプル:");
flexSheet.setCellData(75, 2, "var(74,47,68,99,106,13,51)");
flexSheet.setCellData(76, 1, "結果:");
flexSheet.setCellData(76, 2, "=var(74,47,68,99,106,13,51)");
flexSheet.setCellData(78, 1, "9. VarP");
flexSheet.setCellData(79, 1, "母集団分散を返します。");
flexSheet.setCellData(80, 1, "サンプル:");
flexSheet.setCellData(80, 2, "varp(C2:H4)");
flexSheet.setCellData(81, 1, "結果:");
flexSheet.setCellData(81, 2, "=varp(C2:H4)");
flexSheet.setCellData(82, 1, "サンプル:");
flexSheet.setCellData(82, 2, "varp(74,47,68,99,106,13,51)");
flexSheet.setCellData(83, 1, "結果:");
flexSheet.setCellData(83, 2, "=varp(74,47,68,99,106,13,51)");
flexSheet.setCellData(85, 1, "10. CountA");
flexSheet.setCellData(86, 1, "引数リストに含まれる値の個数を返します。");
flexSheet.setCellData(87, 1, "サンプル:");
flexSheet.setCellData(87, 2, "counta(E7:E21)");
flexSheet.setCellData(88, 1, "結果:");
flexSheet.setCellData(88, 2, "=counta(E7:E21)");
flexSheet.setCellData(90, 1, "11. CountBlank");
flexSheet.setCellData(91, 1, "範囲内に含まれる空白セルの個数を返します。");
flexSheet.setCellData(92, 1, "サンプル:");
flexSheet.setCellData(92, 2, "countblank(E7:E21)");
flexSheet.setCellData(93, 1, "結果:");
flexSheet.setCellData(93, 2, "=countblank(E7:E21)");
flexSheet.setCellData(95, 1, "12. CountIf");
flexSheet.setCellData(96, 1, "範囲内に含まれる特定の基準を満たすセルの個数を返します。");
flexSheet.setCellData(97, 1, "構文:");
flexSheet.setCellData(97, 2, "countif(range, criteria)");
flexSheet.setCellData(98, 1, "サンプル:");
flexSheet.setCellData(98, 2, "countif(B12:B21, \"Apple\")");
flexSheet.setCellData(99, 1, "結果:");
flexSheet.setCellData(99, 2, "=countif(B12:B21, \"Apple\")");
flexSheet.setCellData(100, 1, "サンプル:");
flexSheet.setCellData(100, 2, "countif(C12:C21, \">10\")");
flexSheet.setCellData(101, 1, "結果:");
flexSheet.setCellData(101, 2, "=countif(C12:C21, \">10\")");
flexSheet.setCellData(103, 1, "13. CountIfs");
flexSheet.setCellData(104, 1, "範囲内に含まれる複数の条件を満たすセルの個数を返します。");
flexSheet.setCellData(105, 1, "構文:");
flexSheet.setCellData(105, 2, "countifs(criteria_range1, criteria1, [criteria_range2, criteria2],...)");
flexSheet.setCellData(106, 1, "サンプル:");
flexSheet.setCellData(106, 2, "countifs(B12:B21, \"Apple\", C12:C21, \">10\")");
flexSheet.setCellData(107, 1, "結果:");
flexSheet.setCellData(107, 2, "=countifs(B12:B21, \"Apple\", C12:C21, \">10\")");
flexSheet.setCellData(109, 1, "14. DCount");
flexSheet.setCellData(110, 1, "データベース内の数値を含むセルをカウントします。");
flexSheet.setCellData(111, 1, "構文:");
flexSheet.setCellData(111, 2, "countifs(count_range, field, criteria_range)");
flexSheet.setCellData(112, 1, "サンプル:");
flexSheet.setCellData(112, 2, "dcount(B11:F21, \"Age\", B7:G9)");
flexSheet.setCellData(113, 1, "結果:");
flexSheet.setCellData(113, 2, "=dcount(B11:F21, \"Age\", B7:G9)");
flexSheet.setCellData(115, 1, "15. SumIf");
flexSheet.setCellData(116, 1, "指定された条件に合致するセルを加算します。");
flexSheet.setCellData(117, 1, "構文:");
flexSheet.setCellData(117, 2, "sumif(range, criteria, [sum_range])");
flexSheet.setCellData(118, 1, "備考:");
flexSheet.setCellData(118, 2, "sum_range引数が省略された場合、range引数で指定されたセルを追加します。");
flexSheet.setCellData(119, 1, "サンプル:");
flexSheet.setCellData(119, 2, "sumif(B12:B21, \"Apple\", C12:C21)");
flexSheet.setCellData(120, 1, "結果:");
flexSheet.setCellData(120, 2, "=sumif(B12:B21, \"Apple\", C12:C21)");
flexSheet.setCellData(121, 1, "サンプル:");
flexSheet.setCellData(121, 2, "sumif(C12:C21, \">10\")");
flexSheet.setCellData(122, 1, "結果:");
flexSheet.setCellData(122, 2, "=sumif(C12:C21, \">10\")");
flexSheet.setCellData(124, 1, "16. SumIfs");
flexSheet.setCellData(125, 1, "範囲内に含まれる複数の条件を満たすセルを加算します。");
flexSheet.setCellData(126, 1, "構文:");
flexSheet.setCellData(126, 2, "sumifs(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2],...)");
flexSheet.setCellData(127, 1, "サンプル:");
flexSheet.setCellData(127, 2, "sumifs(F12:F21, B12:B21, \"Apple\", C12:C21, \">10\")");
flexSheet.setCellData(128, 1, "結果:");
flexSheet.setCellData(128, 2, "=sumifs(F12:F21, B12:B21, \"Apple\", C12:C21, \">10\")");
flexSheet.setCellData(130, 1, "17. Rank");
flexSheet.setCellData(131, 1, "数値リスト内の数値のランクを返します。");
flexSheet.setCellData(132, 1, "構文:");
flexSheet.setCellData(132, 2, "rank(number, ref, [order])");
flexSheet.setCellData(133, 1, "備考:");
flexSheet.setCellData(133, 2, "orderがゼロまたは省略された場合は、refが降順でソートされたリストであるかのように数をランク付けします。");
flexSheet.setCellData(134, 2, "orderがゼロ以外の任意の数である場合は、refが昇順でソートされたリストであるかのように数をランク付けします。");
flexSheet.setCellData(135, 1, "サンプル:");
flexSheet.setCellData(135, 2, "rank(15, C12:C21)");
flexSheet.setCellData(136, 1, "結果:");
flexSheet.setCellData(136, 2, "=rank(15, C12:C21)");
flexSheet.setCellData(137, 1, "サンプル:");
flexSheet.setCellData(137, 2, "rank(15, C12:C21, 1)");
flexSheet.setCellData(138, 1, "結果:");
flexSheet.setCellData(138, 2, "=rank(15, C12:C21, 1)");
flexSheet.setCellData(140, 1, "18. Product");
flexSheet.setCellData(141, 1, "引数を乗算します。");
flexSheet.setCellData(142, 1, "サンプル:");
flexSheet.setCellData(142, 2, "product(C12:E12)");
flexSheet.setCellData(143, 1, "結果:");
flexSheet.setCellData(143, 2, "=product(C12:E12)");
flexSheet.setCellData(144, 1, "サンプル:");
flexSheet.setCellData(144, 2, "product(1, 2, 3, 4, 5)");
flexSheet.setCellData(145, 1, "結果:");
flexSheet.setCellData(145, 2, "=product(1, 2, 3, 4, 5)");
flexSheet.setCellData(147, 1, "19. Subtotal");
flexSheet.setCellData(148, 1, "リストまたはデータベースの小計を返します。");
flexSheet.setCellData(149, 1, "構文:");
flexSheet.setCellData(149, 2, "subtotal(function_num, ref1, [ref2],...)");
flexSheet.setCellData(150, 1, "備考:");
flexSheet.setCellData(150, 2, "function_numは1~11または101~111の数字で、小計の算出に使用する関数を指定します。");
flexSheet.setCellData(151, 2, "1~11には手動で非表示にした行が含まれますが、101~111には含まれません。");
flexSheet.setCellData(152, 2, "Function_Num");
flexSheet.setCellData(152, 4, "Function_Num");
flexSheet.setCellData(152, 6, "Function");
flexSheet.setCellData(153, 2, "(非表示の値を含む)");
flexSheet.setCellData(153, 4, "(非表示の値を無視する)");
flexSheet.setCellData(154, 2, "1");
flexSheet.setCellData(154, 4, "101");
flexSheet.setCellData(154, 6, "Average");
flexSheet.setCellData(155, 2, "2");
flexSheet.setCellData(155, 4, "102");
flexSheet.setCellData(155, 6, "Count");
flexSheet.setCellData(156, 2, "3");
flexSheet.setCellData(156, 4, "103");
flexSheet.setCellData(156, 6, "CountA");
flexSheet.setCellData(157, 2, "4");
flexSheet.setCellData(157, 4, "104");
flexSheet.setCellData(157, 6, "Max");
flexSheet.setCellData(158, 2, "5");
flexSheet.setCellData(158, 4, "105");
flexSheet.setCellData(158, 6, "Min");
flexSheet.setCellData(159, 2, "6");
flexSheet.setCellData(159, 4, "106");
flexSheet.setCellData(159, 6, "Product");
flexSheet.setCellData(160, 2, "7");
flexSheet.setCellData(160, 4, "107");
flexSheet.setCellData(160, 6, "Stdev");
flexSheet.setCellData(161, 2, "8");
flexSheet.setCellData(161, 4, "108");
flexSheet.setCellData(161, 6, "StdevP");
flexSheet.setCellData(162, 2, "9");
flexSheet.setCellData(162, 4, "109");
flexSheet.setCellData(162, 6, "Sum");
flexSheet.setCellData(163, 2, "10");
flexSheet.setCellData(163, 4, "110");
flexSheet.setCellData(163, 6, "Var");
flexSheet.setCellData(164, 2, "11");
flexSheet.setCellData(164, 4, "111");
flexSheet.setCellData(164, 6, "VarP");
flexSheet.setCellData(165, 1, "サンプル:");
flexSheet.setCellData(165, 2, "subtotal(3, B7:D9, G7:G10)");
flexSheet.setCellData(166, 1, "結果:");
flexSheet.setCellData(166, 2, "=subtotal(3, B7:D9, G7:G10)");
flexSheet.setCellData(167, 1, "サンプル:");
flexSheet.setCellData(167, 2, "subtotal(6, E12:F12)");
flexSheet.setCellData(168, 1, "結果:");
flexSheet.setCellData(168, 2, "=subtotal(6, E12:F12)");
flexSheet.applyCellsStyle({
fontWeight: 'bold'
}, [new wjGrid.CellRange(22, 1, 22, 1),
new wjGrid.CellRange(29, 1, 29, 1),
new wjGrid.CellRange(36, 1, 36, 1),
new wjGrid.CellRange(43, 1, 43, 1),
new wjGrid.CellRange(50, 1, 50, 1),
new wjGrid.CellRange(57, 1, 57, 1),
new wjGrid.CellRange(64, 1, 64, 1),
new wjGrid.CellRange(71, 1, 71, 1),
new wjGrid.CellRange(78, 1, 78, 1),
new wjGrid.CellRange(85, 1, 85, 1),
new wjGrid.CellRange(90, 1, 90, 2),
new wjGrid.CellRange(95, 1, 95, 1),
new wjGrid.CellRange(103, 1, 103, 1),
new wjGrid.CellRange(109, 1, 109, 1),
new wjGrid.CellRange(115, 1, 115, 1),
new wjGrid.CellRange(124, 1, 124, 1),
new wjGrid.CellRange(130, 1, 130, 1),
new wjGrid.CellRange(140, 1, 140, 1),
new wjGrid.CellRange(147, 1, 147, 1),
new wjGrid.CellRange(152, 2, 153, 6)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(24, 1, 27, 1),
new wjGrid.CellRange(31, 1, 34, 1),
new wjGrid.CellRange(38, 1, 41, 1),
new wjGrid.CellRange(45, 1, 48, 1),
new wjGrid.CellRange(52, 1, 55, 1),
new wjGrid.CellRange(59, 1, 62, 1),
new wjGrid.CellRange(66, 1, 69, 1),
new wjGrid.CellRange(73, 1, 76, 1),
new wjGrid.CellRange(80, 1, 83, 1),
new wjGrid.CellRange(87, 1, 88, 1),
new wjGrid.CellRange(92, 1, 93, 1),
new wjGrid.CellRange(97, 1, 101, 1),
new wjGrid.CellRange(105, 1, 107, 1),
new wjGrid.CellRange(111, 1, 113, 1),
new wjGrid.CellRange(117, 1, 122, 1),
new wjGrid.CellRange(126, 1, 128, 1),
new wjGrid.CellRange(132, 1, 133, 1), new wjGrid.CellRange(135, 1, 138, 1),
new wjGrid.CellRange(142, 1, 145, 1),
new wjGrid.CellRange(149, 1, 150, 1), new wjGrid.CellRange(165, 1, 168, 1)]);
flexSheet.applyCellsStyle({
textAlign: 'center',
fontWeight: 'bold'
}, [new wjGrid.CellRange(6, 1, 6, 6),
new wjGrid.CellRange(10, 1, 10, 5)]);
flexSheet.applyCellsStyle({
format: 'n2'
}, [new wjGrid.CellRange(1, 1, 4, 7),
new wjGrid.CellRange(11, 5, 20, 5)]);
flexSheet.mergeRange(new wjGrid.CellRange(23, 1, 23, 2));
flexSheet.mergeRange(new wjGrid.CellRange(26, 2, 26, 3));
flexSheet.mergeRange(new wjGrid.CellRange(30, 1, 30, 3));
flexSheet.mergeRange(new wjGrid.CellRange(33, 2, 33, 3));
flexSheet.mergeRange(new wjGrid.CellRange(37, 1, 37, 4));
flexSheet.mergeRange(new wjGrid.CellRange(40, 2, 40, 3));
flexSheet.mergeRange(new wjGrid.CellRange(42, 1, 42, 3));
flexSheet.mergeRange(new wjGrid.CellRange(44, 1, 44, 3));
flexSheet.mergeRange(new wjGrid.CellRange(47, 2, 47, 3));
flexSheet.mergeRange(new wjGrid.CellRange(51, 1, 51, 3));
flexSheet.mergeRange(new wjGrid.CellRange(54, 2, 54, 3));
flexSheet.mergeRange(new wjGrid.CellRange(58, 1, 58, 3));
flexSheet.mergeRange(new wjGrid.CellRange(61, 2, 61, 3));
flexSheet.mergeRange(new wjGrid.CellRange(65, 1, 65, 4));
flexSheet.mergeRange(new wjGrid.CellRange(68, 2, 68, 3));
flexSheet.mergeRange(new wjGrid.CellRange(72, 1, 72, 3));
flexSheet.mergeRange(new wjGrid.CellRange(75, 2, 75, 3));
flexSheet.mergeRange(new wjGrid.CellRange(79, 1, 79, 3));
flexSheet.mergeRange(new wjGrid.CellRange(82, 2, 82, 3));
flexSheet.mergeRange(new wjGrid.CellRange(86, 1, 86, 4));
flexSheet.mergeRange(new wjGrid.CellRange(90, 1, 90, 2));
flexSheet.mergeRange(new wjGrid.CellRange(91, 1, 91, 3));
flexSheet.mergeRange(new wjGrid.CellRange(92, 2, 92, 3));
flexSheet.mergeRange(new wjGrid.CellRange(96, 1, 96, 4));
flexSheet.mergeRange(new wjGrid.CellRange(97, 2, 97, 3));
flexSheet.mergeRange(new wjGrid.CellRange(98, 2, 98, 3));
flexSheet.mergeRange(new wjGrid.CellRange(100, 2, 100, 3));
flexSheet.mergeRange(new wjGrid.CellRange(104, 1, 104, 4));
flexSheet.mergeRange(new wjGrid.CellRange(105, 2, 105, 5));
flexSheet.mergeRange(new wjGrid.CellRange(106, 2, 106, 4));
flexSheet.mergeRange(new wjGrid.CellRange(110, 1, 110, 4));
flexSheet.mergeRange(new wjGrid.CellRange(111, 2, 111, 4));
flexSheet.mergeRange(new wjGrid.CellRange(112, 2, 112, 3));
flexSheet.mergeRange(new wjGrid.CellRange(116, 1, 116, 3));
flexSheet.mergeRange(new wjGrid.CellRange(117, 2, 117, 4));
flexSheet.mergeRange(new wjGrid.CellRange(118, 2, 118, 7));
flexSheet.mergeRange(new wjGrid.CellRange(119, 2, 119, 3));
flexSheet.mergeRange(new wjGrid.CellRange(121, 2, 121, 3));
flexSheet.mergeRange(new wjGrid.CellRange(125, 1, 125, 3));
flexSheet.mergeRange(new wjGrid.CellRange(126, 2, 126, 6));
flexSheet.mergeRange(new wjGrid.CellRange(127, 2, 127, 4));
flexSheet.mergeRange(new wjGrid.CellRange(131, 1, 131, 3));
flexSheet.mergeRange(new wjGrid.CellRange(132, 2, 132, 3));
flexSheet.mergeRange(new wjGrid.CellRange(133, 2, 133, 7));
flexSheet.mergeRange(new wjGrid.CellRange(134, 2, 134, 7));
flexSheet.mergeRange(new wjGrid.CellRange(135, 2, 135, 3));
flexSheet.mergeRange(new wjGrid.CellRange(137, 2, 137, 3));
flexSheet.mergeRange(new wjGrid.CellRange(141, 1, 141, 2));
flexSheet.mergeRange(new wjGrid.CellRange(142, 2, 142, 3));
flexSheet.mergeRange(new wjGrid.CellRange(144, 2, 144, 3));
flexSheet.mergeRange(new wjGrid.CellRange(148, 1, 148, 3));
flexSheet.mergeRange(new wjGrid.CellRange(149, 2, 149, 4));
flexSheet.mergeRange(new wjGrid.CellRange(150, 2, 150, 6));
flexSheet.mergeRange(new wjGrid.CellRange(151, 2, 151, 5));
flexSheet.mergeRange(new wjGrid.CellRange(152, 2, 152, 3));
flexSheet.mergeRange(new wjGrid.CellRange(152, 4, 152, 5));
flexSheet.mergeRange(new wjGrid.CellRange(153, 2, 153, 3));
flexSheet.mergeRange(new wjGrid.CellRange(153, 4, 153, 5));
flexSheet.mergeRange(new wjGrid.CellRange(165, 2, 165, 3));
flexSheet.mergeRange(new wjGrid.CellRange(167, 2, 167, 3));
}
function generateDateSheet(flexSheet) {
flexSheet.setCellData(0, 1, "1. Now");
flexSheet.setCellData(1, 1, "現在の日時のシリアル値を返します。");
flexSheet.setCellData(2, 1, "サンプル:");
flexSheet.setCellData(2, 2, "Now()");
flexSheet.setCellData(2, 3, "結果:");
flexSheet.setCellData(2, 4, "=Now()");
flexSheet.setCellData(4, 1, "2. Year");
flexSheet.setCellData(5, 1, "シリアル値を年に変換します。");
flexSheet.setCellData(6, 1, "サンプル:");
flexSheet.setCellData(6, 2, "Year(E3)");
flexSheet.setCellData(6, 3, "結果:");
flexSheet.setCellData(6, 4, "=Year(E3)");
flexSheet.setCellData(8, 1, "3. Month");
flexSheet.setCellData(9, 1, "シリアル値を月に変換します。");
flexSheet.setCellData(10, 1, "サンプル:");
flexSheet.setCellData(10, 2, "Month(E3)");
flexSheet.setCellData(10, 3, "結果:");
flexSheet.setCellData(10, 4, "=Month(E3)");
flexSheet.setCellData(12, 1, "4. Day");
flexSheet.setCellData(13, 1, "シリアル値を月の日付に変換します。");
flexSheet.setCellData(14, 1, "サンプル:");
flexSheet.setCellData(14, 2, "Day(E3)");
flexSheet.setCellData(14, 3, "結果:");
flexSheet.setCellData(14, 4, "=Day(E3)");
flexSheet.setCellData(16, 1, "5. Today");
flexSheet.setCellData(17, 1, "今日の日付のシリアル値を返します。");
flexSheet.setCellData(18, 1, "サンプル:");
flexSheet.setCellData(18, 2, "today()");
flexSheet.setCellData(18, 3, "結果:");
flexSheet.setCellData(18, 4, "=today()");
flexSheet.setCellData(20, 1, "6. Date");
flexSheet.setCellData(21, 1, "特定の日付のシリアル値を返します。");
flexSheet.setCellData(22, 1, "サンプル:");
flexSheet.setCellData(22, 2, "date(2015, 11, 26)");
flexSheet.setCellData(23, 1, "結果:");
flexSheet.setCellData(23, 2, "=date(2015, 11, 26)");
flexSheet.setCellData(25, 1, "7. Time");
flexSheet.setCellData(26, 1, "特定の時刻のシリアル値を返します。");
flexSheet.setCellData(27, 1, "サンプル:");
flexSheet.setCellData(27, 2, "time(11, 28, 33)");
flexSheet.setCellData(28, 1, "結果:");
flexSheet.setCellData(28, 2, "=time(11, 28, 33)");
flexSheet.setCellData(30, 1, "8. Hour");
flexSheet.setCellData(31, 1, "シリアル値を時間に変換します。");
flexSheet.setCellData(32, 1, "サンプル:");
flexSheet.setCellData(32, 2, "hour(C29)");
flexSheet.setCellData(32, 3, "結果:");
flexSheet.setCellData(32, 4, "=hour(C29)");
flexSheet.setCellData(33, 1, "サンプル:");
flexSheet.setCellData(33, 2, "hour(0.65)");
flexSheet.setCellData(33, 3, "結果:");
flexSheet.setCellData(33, 4, "=hour(0.65)");
flexSheet.setCellData(35, 1, "9. DateDif");
flexSheet.setCellData(36, 1, "2つの日付の間の日数、月数、または年数を計算します。");
flexSheet.setCellData(37, 1, "構文:");
flexSheet.setCellData(37, 2, "DateDif(start_date, end_date, unit)");
flexSheet.setCellData(38, 1, "unit引数には次の値を指定できます。");
flexSheet.setCellData(39, 1, "\"Y\"");
flexSheet.setCellData(39, 2, "期間の年数です。");
flexSheet.setCellData(40, 1, "\"M\"");
flexSheet.setCellData(40, 2, "期間の月数です。");
flexSheet.setCellData(41, 1, "\"D\"");
flexSheet.setCellData(41, 2, "期間の日数です。");
flexSheet.setCellData(42, 1, "\"MD\"");
flexSheet.setCellData(42, 2, "開始日から終了日までの日数です。日付の月数および年数は無視されます。");
flexSheet.setCellData(43, 1, "\"YM\"");
flexSheet.setCellData(43, 2, "開始日から終了日までの月数です。日付の日数および年数は無視されます。");
flexSheet.setCellData(44, 1, "\"YD\"");
flexSheet.setCellData(44, 2, "開始日から終了日までの日数です。日付の年数は無視されます。");
flexSheet.setCellData(45, 1, "サンプル:");
flexSheet.setCellData(45, 2, "datedif(\"11/26/2012\", \"8/15/2015\", \"Y\")");
flexSheet.setCellData(46, 1, "結果:");
flexSheet.setCellData(46, 2, "=datedif(\"11/26/2012\", \"8/15/2015\", \"Y\")");
flexSheet.setCellData(47, 1, "サンプル:");
flexSheet.setCellData(47, 2, "datedif(\"5/26/2015\", \"11/15/2015\", \"M\")");
flexSheet.setCellData(48, 1, "結果:");
flexSheet.setCellData(48, 2, "=datedif(\"5/26/2015\", \"11/15/2015\", \"M\")");
flexSheet.setCellData(49, 1, "サンプル:");
flexSheet.setCellData(49, 2, "datedif(\"2/26/2014\", \"3/15/2015\", \"D\")");
flexSheet.setCellData(50, 1, "結果:");
flexSheet.setCellData(50, 2, "=datedif(\"2/26/2014\", \"3/15/2015\", \"D\")");
flexSheet.setCellData(51, 1, "サンプル:");
flexSheet.setCellData(51, 2, "datedif(\"3/26/2015\", \"2/15/2016\", \"MD\")");
flexSheet.setCellData(52, 1, "結果:");
flexSheet.setCellData(52, 2, "=datedif(\"3/26/2015\", \"2/15/2016\", \"MD\")");
flexSheet.setCellData(53, 1, "サンプル:");
flexSheet.setCellData(53, 2, "datedif(\"11/26/2015\", \"2/15/2016\", \"YM\")");
flexSheet.setCellData(54, 1, "結果:");
flexSheet.setCellData(54, 2, "=datedif(\"11/26/2015\", \"2/15/2016\", \"YM\")");
flexSheet.setCellData(55, 1, "サンプル:");
flexSheet.setCellData(55, 2, "datedif(\"2/26/2016\", \"2/15/2017\", \"YD\")");
flexSheet.setCellData(56, 1, "結果:");
flexSheet.setCellData(56, 2, "=datedif(\"2/26/2016\", \"2/15/2017\", \"YD\")");
flexSheet.applyCellsStyle({
fontWeight: 'bold'
}, [new wjGrid.CellRange(0, 1, 0, 1),
new wjGrid.CellRange(4, 1, 4, 1),
new wjGrid.CellRange(8, 1, 8, 1),
new wjGrid.CellRange(12, 1, 12, 1),
new wjGrid.CellRange(16, 1, 16, 1),
new wjGrid.CellRange(20, 1, 20, 1),
new wjGrid.CellRange(25, 1, 25, 1),
new wjGrid.CellRange(30, 1, 30, 1),
new wjGrid.CellRange(35, 1, 35, 1),
new wjGrid.CellRange(39, 1, 44, 1)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(2, 1, 2, 1), new wjGrid.CellRange(2, 3, 2, 3),
new wjGrid.CellRange(6, 1, 6, 1), new wjGrid.CellRange(6, 3, 6, 3),
new wjGrid.CellRange(10, 1, 10, 1), new wjGrid.CellRange(10, 3, 10, 3),
new wjGrid.CellRange(14, 1, 14, 1), new wjGrid.CellRange(14, 3, 14, 3),
new wjGrid.CellRange(18, 1, 18, 1), new wjGrid.CellRange(18, 3, 18, 3),
new wjGrid.CellRange(22, 1, 23, 1),
new wjGrid.CellRange(27, 1, 28, 1),
new wjGrid.CellRange(32, 1, 33, 1), new wjGrid.CellRange(32, 3, 33, 3),
new wjGrid.CellRange(37, 1, 37, 1),
new wjGrid.CellRange(39, 1, 56, 1)]);
flexSheet.mergeRange(new wjGrid.CellRange(1, 1, 1, 4));
flexSheet.mergeRange(new wjGrid.CellRange(2, 4, 2, 5));
flexSheet.mergeRange(new wjGrid.CellRange(5, 1, 5, 3));
flexSheet.mergeRange(new wjGrid.CellRange(9, 1, 9, 3));
flexSheet.mergeRange(new wjGrid.CellRange(13, 1, 13, 3));
flexSheet.mergeRange(new wjGrid.CellRange(17, 1, 17, 3));
flexSheet.mergeRange(new wjGrid.CellRange(21, 1, 21, 3));
flexSheet.mergeRange(new wjGrid.CellRange(22, 2, 22, 3));
flexSheet.mergeRange(new wjGrid.CellRange(26, 1, 26, 3));
flexSheet.mergeRange(new wjGrid.CellRange(27, 2, 27, 3));
flexSheet.mergeRange(new wjGrid.CellRange(31, 1, 31, 3));
flexSheet.mergeRange(new wjGrid.CellRange(36, 1, 36, 4));
flexSheet.mergeRange(new wjGrid.CellRange(37, 2, 37, 4));
flexSheet.mergeRange(new wjGrid.CellRange(38, 1, 38, 3));
flexSheet.mergeRange(new wjGrid.CellRange(39, 2, 39, 4));
flexSheet.mergeRange(new wjGrid.CellRange(40, 2, 40, 4));
flexSheet.mergeRange(new wjGrid.CellRange(41, 2, 41, 3));
flexSheet.mergeRange(new wjGrid.CellRange(42, 2, 42, 8));
flexSheet.mergeRange(new wjGrid.CellRange(43, 2, 43, 8));
flexSheet.mergeRange(new wjGrid.CellRange(44, 2, 44, 7));
flexSheet.mergeRange(new wjGrid.CellRange(45, 2, 45, 4));
flexSheet.mergeRange(new wjGrid.CellRange(47, 2, 47, 4));
flexSheet.mergeRange(new wjGrid.CellRange(49, 2, 49, 4));
flexSheet.mergeRange(new wjGrid.CellRange(51, 2, 51, 4));
flexSheet.mergeRange(new wjGrid.CellRange(53, 2, 53, 4));
flexSheet.mergeRange(new wjGrid.CellRange(55, 2, 55, 4));
}
function generateLookupReferenceSheet(flexSheet) {
flexSheet.setCellData(0, 1, "1. セル参照");
flexSheet.setCellData(1, 1, "FlexSheetの指定したセルの値を取得します。");
flexSheet.setCellData(2, 1, "サンプル:");
flexSheet.setCellData(2, 2, "B1");
flexSheet.setCellData(2, 3, "結果:");
flexSheet.setCellData(2, 4, "=B1");
flexSheet.setCellData(4, 1, "2. Choose");
flexSheet.setCellData(5, 1, "値のリストから値を選択します。");
flexSheet.setCellData(6, 1, "サンプル:");
flexSheet.setCellData(6, 2, "choose(2, \"Hello\", \"World\", \"for\", \"test\")");
flexSheet.setCellData(7, 1, "結果:");
flexSheet.setCellData(7, 2, "=choose(2, \"Hello\", \"World\", \"for\", \"test\")");
flexSheet.setCellData(9, 1, "3. Column");
flexSheet.setCellData(10, 1, "参照の列番号を返します。");
flexSheet.setCellData(11, 1, "サンプル:");
flexSheet.setCellData(11, 2, "column(E1)");
flexSheet.setCellData(11, 3, "結果:");
flexSheet.setCellData(11, 4, "=column(E1)");
flexSheet.setCellData(13, 1, "4. Columns");
flexSheet.setCellData(14, 1, "参照内の列の数を返します。");
flexSheet.setCellData(15, 1, "サンプル:");
flexSheet.setCellData(15, 2, "columns(B2:D5)");
flexSheet.setCellData(15, 3, "結果:");
flexSheet.setCellData(15, 4, "=columns(B2:D5)");
flexSheet.setCellData(17, 1, "5. Row");
flexSheet.setCellData(18, 1, "参照の行番号を返します。");
flexSheet.setCellData(19, 1, "サンプル:");
flexSheet.setCellData(19, 2, "row(B21)");
flexSheet.setCellData(19, 3, "結果:");
flexSheet.setCellData(19, 4, "=row(B21)");
flexSheet.setCellData(21, 1, "6. Rows");
flexSheet.setCellData(22, 1, "参照内の行の数を返します。");
flexSheet.setCellData(23, 1, "サンプル:");
flexSheet.setCellData(23, 2, "rows(B21:E13)");
flexSheet.setCellData(23, 3, "結果:");
flexSheet.setCellData(23, 4, "=rows(B21:E13)");
flexSheet.setCellData(25, 1, "7. Index");
flexSheet.setCellData(26, 1, "インデックスを使用して、参照から値を選択します。");
flexSheet.setCellData(27, 1, "構文:");
flexSheet.setCellData(27, 2, "index(range,row_num,[col_num])");
flexSheet.setCellData(28, 1, "備考:");
flexSheet.setCellData(28, 2, "row_numまたはcolumn_numを0に設定すると、それぞれ列全体または行全体の値の配列が返されます。");
flexSheet.setCellData(29, 1, "サンプル:");
flexSheet.setCellData(29, 2, "index(B46:F49, 2, 2)");
flexSheet.setCellData(30, 1, "結果:");
flexSheet.setCellData(30, 2, "=index(B46:F49, 2, 2)");
flexSheet.setCellData(31, 1, "サンプル:");
flexSheet.setCellData(31, 2, "sum(index(C47:D48, 0, 1))");
flexSheet.setCellData(32, 1, "結果:");
flexSheet.setCellData(32, 2, "=sum(index(C47:D48, 0, 1))");
flexSheet.setCellData(34, 1, "8. HLookup");
flexSheet.setCellData(35, 1, "配列の先頭の行を検索し、示されたセルの値を返します。");
flexSheet.setCellData(36, 1, "構文:");
flexSheet.setCellData(36, 2, "hlookup(lookup_value, range, row_index_num, [range_lookup])");
flexSheet.setCellData(37, 1, "備考:");
flexSheet.setCellData(37, 2, "range_lookupは、HLOOKUPを使用して検索値と完全に一致する値だけを検索するか、その近似値を含めて検索するか");
flexSheet.setCellData(38, 2, "を指定する論理値です。");
flexSheet.setCellData(39, 2, "TRUE を指定するか省略した場合、近似値が返されます。");
flexSheet.setCellData(40, 2, "つまり、完全に一致する値が見つからない場合は、検索値未満の最大値が使用されます。");
flexSheet.setCellData(41, 2, "FALSE を指定した場合、HLOOKUP では完全に一致する値が検索されます。");
flexSheet.setCellData(42, 2, "range_lookupがFALSEで検索値が文字列の場合、");
flexSheet.setCellData(43, 2, "検索値で疑問符 (?) またはアスタリスク (*) をワイルドカード文字として使用できます。");
flexSheet.setCellData(44, 1, "サンプルデータ:");
flexSheet.setCellData(45, 1, "4Test");
flexSheet.setCellData(45, 2, "Test4");
flexSheet.setCellData(45, 3, "4Test4");
flexSheet.setCellData(45, 4, "44Test4");
flexSheet.setCellData(45, 5, "4Test44");
flexSheet.setCellData(46, 1, "1");
flexSheet.setCellData(46, 2, "101");
flexSheet.setCellData(46, 3, "1001");
flexSheet.setCellData(46, 4, "5001");
flexSheet.setCellData(46, 5, "10001");
flexSheet.setCellData(47, 1, "0.1");
flexSheet.setCellData(47, 2, "0.2");
flexSheet.setCellData(47, 3, "0.3");
flexSheet.setCellData(47, 4, "0.5");
flexSheet.setCellData(47, 5, "0.8");
flexSheet.setCellData(48, 1, "サンプル:");
flexSheet.setCellData(48, 2, "hlookup(7500, B47:F48, 2)");
flexSheet.setCellData(49, 1, "結果:");
flexSheet.setCellData(49, 2, "=hlookup(7500, B47:F48, 2)");
flexSheet.setCellData(50, 1, "サンプル:");
flexSheet.setCellData(50, 2, "hlookup(\"?test?\", B46:F48, 3, false)");
flexSheet.setCellData(51, 1, "結果:");
flexSheet.setCellData(51, 2, "=hlookup(\"?test?\", B46:F48, 3, false)");
flexSheet.applyCellsStyle({
fontWeight: 'bold'
}, [new wjGrid.CellRange(0, 1, 0, 1),
new wjGrid.CellRange(4, 1, 4, 1),
new wjGrid.CellRange(9, 1, 9, 1),
new wjGrid.CellRange(13, 1, 13, 1),
new wjGrid.CellRange(17, 1, 17, 1),
new wjGrid.CellRange(21, 1, 21, 1),
new wjGrid.CellRange(25, 1, 25, 1),
new wjGrid.CellRange(34, 1, 34, 1),
new wjGrid.CellRange(45, 1, 45, 5)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(2, 1, 2, 1), new wjGrid.CellRange(2, 3, 2, 3),
new wjGrid.CellRange(6, 1, 7, 1),
new wjGrid.CellRange(11, 1, 11, 1), new wjGrid.CellRange(11, 3, 11, 3),
new wjGrid.CellRange(15, 1, 15, 1), new wjGrid.CellRange(15, 3, 15, 3),
new wjGrid.CellRange(19, 1, 19, 1), new wjGrid.CellRange(19, 3, 19, 3),
new wjGrid.CellRange(23, 1, 23, 1), new wjGrid.CellRange(23, 3, 23, 3),
new wjGrid.CellRange(27, 1, 32, 1),
new wjGrid.CellRange(36, 1, 37, 1),
new wjGrid.CellRange(48, 1, 51, 1)]);
flexSheet.mergeRange(new wjGrid.CellRange(0, 1, 0, 2));
flexSheet.mergeRange(new wjGrid.CellRange(1, 1, 1, 3));
flexSheet.mergeRange(new wjGrid.CellRange(2, 4, 2, 6));
flexSheet.mergeRange(new wjGrid.CellRange(5, 1, 5, 3));
flexSheet.mergeRange(new wjGrid.CellRange(6, 2, 6, 4));
flexSheet.mergeRange(new wjGrid.CellRange(10, 1, 10, 3));
flexSheet.mergeRange(new wjGrid.CellRange(14, 1, 14, 3));
flexSheet.mergeRange(new wjGrid.CellRange(18, 1, 18, 3));
flexSheet.mergeRange(new wjGrid.CellRange(22, 1, 22, 3));
flexSheet.mergeRange(new wjGrid.CellRange(26, 1, 26, 3));
flexSheet.mergeRange(new wjGrid.CellRange(27, 2, 27, 3));
flexSheet.mergeRange(new wjGrid.CellRange(28, 2, 28, 7));
flexSheet.mergeRange(new wjGrid.CellRange(29, 2, 29, 3));
flexSheet.mergeRange(new wjGrid.CellRange(31, 2, 31, 3));
flexSheet.mergeRange(new wjGrid.CellRange(35, 1, 35, 5));
flexSheet.mergeRange(new wjGrid.CellRange(36, 2, 36, 5));
flexSheet.mergeRange(new wjGrid.CellRange(37, 2, 37, 7));
flexSheet.mergeRange(new wjGrid.CellRange(38, 2, 38, 3));
flexSheet.mergeRange(new wjGrid.CellRange(39, 2, 39, 5));
flexSheet.mergeRange(new wjGrid.CellRange(40, 2, 40, 8));
flexSheet.mergeRange(new wjGrid.CellRange(41, 2, 41, 4));
flexSheet.mergeRange(new wjGrid.CellRange(42, 2, 42, 7));
flexSheet.mergeRange(new wjGrid.CellRange(43, 2, 43, 3));
flexSheet.mergeRange(new wjGrid.CellRange(48, 2, 48, 3));
flexSheet.mergeRange(new wjGrid.CellRange(50, 2, 50, 4));
}
function generateFinancialSheet(flexSheet) {
flexSheet.setCellData(0, 1, "1. Rate");
flexSheet.setCellData(1, 1, "期間の年利を返します。");
flexSheet.setCellData(2, 1, "構文:");
flexSheet.setCellData(2, 2, "rate(nper, pmt, pv, [fv], [type], [guess])");
flexSheet.setCellData(3, 1, "RATE関数の書式には、次の引数があります。");
flexSheet.setCellData(4, 1, "nper:");
flexSheet.setCellData(4, 2, "投資期間全体での支払回数の合計を指定します。");
flexSheet.setCellData(5, 1, "pmt:");
flexSheet.setCellData(5, 2, "毎回の支払額を指定します。投資期間内に支払額を変更することはできません。");
flexSheet.setCellData(6, 1, "pv:");
flexSheet.setCellData(6, 2, "将来行われる一連の支払いを、現時点で一括払いした場合の合計金額です。");
flexSheet.setCellData(7, 1, "fv:");
flexSheet.setCellData(7, 2, "投資の将来価値、つまり最後の支払いを行った後に残る現金の収支を指定します。");
flexSheet.setCellData(8, 1, "type:");
flexSheet.setCellData(8, 2, "いつ支払いが行われるかを、数値の0または1で指定します。");
flexSheet.setCellData(9, 2, "0または省略は各期の期末を指します。");
flexSheet.setCellData(10, 2, "1は各期の期首を指します。");
flexSheet.setCellData(11, 1, "guess:");
flexSheet.setCellData(11, 2, "利率がおよそどれくらいになるかを推定した値を指定します。推定値を省略すると、10%として計算されます。");
flexSheet.setCellData(12, 1, "サンプル:");
flexSheet.setCellData(12, 2, "rate(48, -200, 8000)");
flexSheet.setCellData(13, 1, "結果:");
flexSheet.setCellData(13, 2, "=rate(48, -200, 8000)");
flexSheet.applyCellsStyle({
fontWeight: 'bold'
}, [new wjGrid.CellRange(0, 1, 0, 1),
new wjGrid.CellRange(4, 1, 11, 1)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(2, 1, 2, 1), new wjGrid.CellRange(4, 1, 13, 1)]);
flexSheet.mergeRange(new wjGrid.CellRange(1, 1, 1, 3));
flexSheet.mergeRange(new wjGrid.CellRange(2, 2, 2, 4));
flexSheet.mergeRange(new wjGrid.CellRange(3, 1, 3, 4));
flexSheet.mergeRange(new wjGrid.CellRange(4, 2, 4, 4));
flexSheet.mergeRange(new wjGrid.CellRange(5, 2, 5, 6));
flexSheet.mergeRange(new wjGrid.CellRange(6, 2, 6, 5));
flexSheet.mergeRange(new wjGrid.CellRange(7, 2, 7, 6));
flexSheet.mergeRange(new wjGrid.CellRange(8, 2, 8, 5));
flexSheet.mergeRange(new wjGrid.CellRange(9, 2, 9, 4));
flexSheet.mergeRange(new wjGrid.CellRange(10, 2, 10, 4));
flexSheet.mergeRange(new wjGrid.CellRange(11, 2, 11, 6));
flexSheet.mergeRange(new wjGrid.CellRange(12, 2, 12, 3));
}
function generateSummraySheet(flexSheet) {
flexSheet.setCellData(1, 0, '関数種別');
flexSheet.setCellData(1, 2, '関数の数');
flexSheet.setCellData(2, 0, '基本的な演算子');
flexSheet.setCellData(2, 3, 14);
flexSheet.setCellData(3, 0, '数学');
flexSheet.setCellData(3, 3, 21);
flexSheet.setCellData(4, 0, '論理');
flexSheet.setCellData(4, 3, 6);
flexSheet.setCellData(5, 0, 'テキスト');
flexSheet.setCellData(5, 3, 18);
flexSheet.setCellData(6, 0, '集計');
flexSheet.setCellData(6, 3, 19);
flexSheet.setCellData(7, 0, '日付');
flexSheet.setCellData(7, 3, 9);
flexSheet.setCellData(8, 0, '探索と参照');
flexSheet.setCellData(8, 3, 7);
flexSheet.setCellData(9, 0, '財務');
flexSheet.setCellData(9, 3, 1);
flexSheet.setCellData(11, 0, '合計');
flexSheet.setCellData(11, 3, '=SUM(D3:D10)');
flexSheet.applyCellsStyle({
fontWeight: 'bold',
backgroundColor: '#A7D6FF'
}, [new wjGrid.CellRange(1, 0, 1, 3), new wjGrid.CellRange(11, 0, 11, 3)]);
flexSheet.applyCellsStyle({
textAlign: 'right'
}, [new wjGrid.CellRange(2, 3, 11, 3)]);
for (var rowIndex = 3; rowIndex < 11; rowIndex++) {
if (rowIndex % 2 === 1) {
flexSheet.applyCellsStyle({
backgroundColor: '#E5F3FF'
}, [new wjGrid.CellRange(rowIndex, 0, rowIndex, 3)]);
}
}
flexSheet.mergeRange(new wjGrid.CellRange(1, 2, 1, 3));
flexSheet.mergeRange(new wjGrid.CellRange(8, 0, 8, 1));
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>MESCIUS Wijmo FlexSheet Formulas</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- SystemJS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.21.5/system.src.js" integrity="sha512-skZbMyvYdNoZfLmiGn5ii6KmklM82rYX2uWctBhzaXPxJgiv4XBwJnFGr5k8s+6tE1pcR1nuTKghozJHyzMcoA==" crossorigin="anonymous"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('./src/app');
</script>
</head>
<body>
<div class="container-fluid">
<div id="formulaSheet"></div>
<p><b>セルの値: </b><span id="cellContent"></span></p>
</div>
</body>
</html>
.wj-flexsheet {
height: 400px;
margin: 6px 0;
}
(function (global) {
System.config({
transpiler: 'plugin-babel',
babelOptions: {
es2015: true
},
meta: {
'*.css': { loader: 'css' }
},
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
'jszip': 'npm:jszip/dist/jszip.js',
'@mescius/wijmo': 'npm:@mescius/wijmo/index.js',
'@mescius/wijmo.input': 'npm:@mescius/wijmo.input/index.js',
'@mescius/wijmo.styles': 'npm:@mescius/wijmo.styles',
'@mescius/wijmo.cultures': 'npm:@mescius/wijmo.cultures',
'@mescius/wijmo.chart': 'npm:@mescius/wijmo.chart/index.js',
'@mescius/wijmo.chart.analytics': 'npm:@mescius/wijmo.chart.analytics/index.js',
'@mescius/wijmo.chart.animation': 'npm:@mescius/wijmo.chart.animation/index.js',
'@mescius/wijmo.chart.annotation': 'npm:@mescius/wijmo.chart.annotation/index.js',
'@mescius/wijmo.chart.finance': 'npm:@mescius/wijmo.chart.finance/index.js',
'@mescius/wijmo.chart.finance.analytics': 'npm:@mescius/wijmo.chart.finance.analytics/index.js',
'@mescius/wijmo.chart.hierarchical': 'npm:@mescius/wijmo.chart.hierarchical/index.js',
'@mescius/wijmo.chart.interaction': 'npm:@mescius/wijmo.chart.interaction/index.js',
'@mescius/wijmo.chart.radar': 'npm:@mescius/wijmo.chart.radar/index.js',
'@mescius/wijmo.chart.render': 'npm:@mescius/wijmo.chart.render/index.js',
'@mescius/wijmo.chart.webgl': 'npm:@mescius/wijmo.chart.webgl/index.js',
'@mescius/wijmo.chart.map': 'npm:@mescius/wijmo.chart.map/index.js',
'@mescius/wijmo.gauge': 'npm:@mescius/wijmo.gauge/index.js',
'@mescius/wijmo.grid': 'npm:@mescius/wijmo.grid/index.js',
'@mescius/wijmo.grid.detail': 'npm:@mescius/wijmo.grid.detail/index.js',
'@mescius/wijmo.grid.filter': 'npm:@mescius/wijmo.grid.filter/index.js',
'@mescius/wijmo.grid.search': 'npm:@mescius/wijmo.grid.search/index.js',
'@mescius/wijmo.grid.grouppanel': 'npm:@mescius/wijmo.grid.grouppanel/index.js',
'@mescius/wijmo.grid.multirow': 'npm:@mescius/wijmo.grid.multirow/index.js',
'@mescius/wijmo.grid.transposed': 'npm:@mescius/wijmo.grid.transposed/index.js',
'@mescius/wijmo.grid.transposedmultirow': 'npm:@mescius/wijmo.grid.transposedmultirow/index.js',
'@mescius/wijmo.grid.pdf': 'npm:@mescius/wijmo.grid.pdf/index.js',
'@mescius/wijmo.grid.sheet': 'npm:@mescius/wijmo.grid.sheet/index.js',
'@mescius/wijmo.grid.xlsx': 'npm:@mescius/wijmo.grid.xlsx/index.js',
'@mescius/wijmo.grid.selector': 'npm:@mescius/wijmo.grid.selector/index.js',
'@mescius/wijmo.grid.cellmaker': 'npm:@mescius/wijmo.grid.cellmaker/index.js',
'@mescius/wijmo.nav': 'npm:@mescius/wijmo.nav/index.js',
'@mescius/wijmo.odata': 'npm:@mescius/wijmo.odata/index.js',
'@mescius/wijmo.olap': 'npm:@mescius/wijmo.olap/index.js',
'@mescius/wijmo.rest': 'npm:@mescius/wijmo.rest/index.js',
'@mescius/wijmo.pdf': 'npm:@mescius/wijmo.pdf/index.js',
'@mescius/wijmo.pdf.security': 'npm:@mescius/wijmo.pdf.security/index.js',
'@mescius/wijmo.viewer': 'npm:@mescius/wijmo.viewer/index.js',
'@mescius/wijmo.xlsx': 'npm:@mescius/wijmo.xlsx/index.js',
'@mescius/wijmo.undo': 'npm:@mescius/wijmo.undo/index.js',
'@mescius/wijmo.interop.grid': 'npm:@mescius/wijmo.interop.grid/index.js',
'@mescius/wijmo.touch': 'npm:@mescius/wijmo.touch/index.js',
'@mescius/wijmo.cloud': 'npm:@mescius/wijmo.cloud/index.js',
'@mescius/wijmo.barcode': 'npm:@mescius/wijmo.barcode/index.js',
'@mescius/wijmo.barcode.common': 'npm:@mescius/wijmo.barcode.common/index.js',
'@mescius/wijmo.barcode.composite': 'npm:@mescius/wijmo.barcode.composite/index.js',
'@mescius/wijmo.barcode.specialized': 'npm:@mescius/wijmo.barcode.specialized/index.js',
'jszip': 'npm:jszip/dist/jszip.js',
'bootstrap.css': 'npm:bootstrap/dist/css/bootstrap.min.css',
'css': 'npm:systemjs-plugin-css/css.js',
'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js',
'systemjs-babel-build':'npm:systemjs-plugin-babel/systemjs-babel-browser.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
src: {
defaultExtension: 'js'
},
"node_modules": {
defaultExtension: 'js'
},
}
});
})(this);