Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
53d363ba
Commit
53d363ba
authored
Aug 09, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify COUNTIF formula
parent
718e41f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+6
-2
cell/model/FormulaObjects/statisticalFunctions.js
cell/model/FormulaObjects/statisticalFunctions.js
+16
-5
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
53d363ba
...
@@ -5797,7 +5797,11 @@ function parseNum( str ) {
...
@@ -5797,7 +5797,11 @@ function parseNum( str ) {
var
res
=
false
,
rS
;
var
res
=
false
,
rS
;
if
(
cElementType
.
string
===
y
.
type
)
{
if
(
cElementType
.
string
===
y
.
type
)
{
if
(
'
<
'
===
operator
||
'
>
'
===
operator
||
'
<=
'
===
operator
||
'
>=
'
===
operator
)
{
if
(
'
<
'
===
operator
||
'
>
'
===
operator
||
'
<=
'
===
operator
||
'
>=
'
===
operator
)
{
return
_func
[
x
.
type
][
y
.
type
](
x
,
y
,
operator
).
toBool
();
var
_funcVal
=
_func
[
x
.
type
][
y
.
type
](
x
,
y
,
operator
);
if
(
cElementType
.
error
===
_funcVal
.
type
){
return
false
;
}
return
_funcVal
.
toBool
();
}
}
y
=
y
.
toString
();
y
=
y
.
toString
();
...
@@ -5838,7 +5842,7 @@ function parseNum( str ) {
...
@@ -5838,7 +5842,7 @@ function parseNum( str ) {
break
;
break
;
case
"
=
"
:
case
"
=
"
:
default
:
default
:
res
=
(
x
.
value
==
y
.
value
);
res
=
(
x
.
value
==
=
y
.
value
);
break
;
break
;
}
}
}
}
...
...
cell/model/FormulaObjects/statisticalFunctions.js
View file @
53d363ba
...
@@ -2623,26 +2623,37 @@
...
@@ -2623,26 +2623,37 @@
arg1
=
arg1
.
getElementRowCol
(
0
,
0
);
arg1
=
arg1
.
getElementRowCol
(
0
,
0
);
}
}
arg1
=
arg1
.
tocString
();
/*
arg1 = arg1.tocString();
if (cElementType.string !== arg1.type) {
if (cElementType.string !== arg1.type) {
return this.value = new cError(cErrorType.wrong_value_type);
return this.value = new cError(cErrorType.wrong_value_type);
}
}*/
var
compareValues
=
function
(
val
,
matchingInfo
){
var
res
;
if
(
val
.
type
===
arg1
.
type
&&
val
.
value
===
arg1
.
value
){
return
true
;
}
res
=
matching
(
val
,
matchingInfo
);
return
res
;
};
var
val
;
var
val
;
matchingInfo
=
AscCommonExcel
.
matchingValue
(
arg1
.
toString
());
matchingInfo
=
AscCommonExcel
.
matchingValue
(
arg1
.
toString
());
if
(
cElementType
.
cellsRange
===
arg0
.
type
)
{
if
(
cElementType
.
cellsRange
===
arg0
.
type
)
{
arg0
.
foreach2
(
function
(
_val
)
{
arg0
.
foreach2
(
function
(
_val
)
{
_count
+=
matching
(
_val
,
matchingInfo
);
_count
+=
compareValues
(
_val
,
matchingInfo
);
})
})
}
else
if
(
cElementType
.
cellsRange3D
===
arg0
.
type
)
{
}
else
if
(
cElementType
.
cellsRange3D
===
arg0
.
type
)
{
val
=
arg0
.
getValue
();
val
=
arg0
.
getValue
();
for
(
var
i
=
0
;
i
<
val
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
val
.
length
;
i
++
)
{
_count
+=
matching
(
val
[
i
],
matchingInfo
);
_count
+=
compareValues
(
val
[
i
],
matchingInfo
);
}
}
}
else
{
}
else
{
val
=
arg0
.
getValue
();
val
=
arg0
.
getValue
();
_count
+=
matching
(
val
,
matchingInfo
);
_count
+=
compareValues
(
val
,
matchingInfo
);
}
}
return
this
.
value
=
new
cNumber
(
_count
);
return
this
.
value
=
new
cNumber
(
_count
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment