如何对存储在单个单元格中的向量执行excel计算?

时间:2018-07-11 16:06:59

标签: excel vector excel-formula

我有一个电子表格,其中每个单元格中都有一个数字矢量(例如{1; 2; 3; 4}),我想执行简单的计算(例如= median(),= max(),(无VBA)涉及))。 Excel以某种方式仅显示和执行每个向量的第一个值。

如何让excel在计算中使用完整矢量(可能还用于图表)?

我所拥有的:

$ firebase deploy --only functions

=== Deploying to 'company-23ere'...

i  deploying functions
i  functions: ensuring necessary APIs are enabled...
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (46.3 KB) for uploading
✔  functions: functions folder uploaded successfully
i  functions: updating function quarterly_job...
i  functions: updating function createNewUser...
i  functions: updating function createStripeCharge...
i  functions: updating function createStripeCustomer...
i  functions: updating function addPaymentSource...
i  functions: updating function cleanupUser...
✔  functions[createStripeCustomer]: Successful update operation. 
✔  functions[createStripeCharge]: Successful update operation. 
✔  functions[addPaymentSource]: Successful update operation. 
✔  functions[createNewUser]: Successful update operation. 
✔  functions[cleanupUser]: Successful update operation. 
✔  functions[quarterly_job]: Successful update operation. 

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/company-23ere/overview
$ firebase functions:log

Error: Failed to list log entries Cannot read property 'substring' of undefined

我想拥有的东西

Actual values in the cells           results in 
 +-A----------+-B----------+         +-A----------+-B----------+
1| ={1;2;3;4} | ={4;3;2;1} |        1|         1  |         4  |
 +------------+------------+         +------------+------------+
2| =median(a1)| =min(B1)   |        2|         1  |         4  |
 +------------+------------+         +------------+------------+

我无济于事的尝试是以

的形式输入值
 +-A----------+-B----------+  
2|        2,5 |         1  |  
 +------------+------------+

2 个答案:

答案 0 :(得分:2)

在A1中:

={1,2,33,4,5}  

(请勿使用Ctrl + Shift + Enter)

在B1中:

=MAX(eval(A1))   '>>> 33

UDF“帮助程序”功能:

Function eval(ByVal rng As Range)
    eval = Application.Evaluate(rng.Formula)
End Function

答案 1 :(得分:2)

没有VBA:

A1:  1;2;3;4

创建一个命名公式:

seq_99   Refers to:  =IF(ROW(INDEX($1:$65535,1,1):INDEX($1:$65535,255,1))=1,1,(ROW(INDEX($1:$65535,1,1):INDEX($1:$65535,255,1))-1)*99)

然后:

=MEDIAN(IFERROR(--TRIM(MID(SUBSTITUTE(A1,";",REPT(" ",99)),seq_99,99)),""))
通过按住 ctrl + shift 并同时按下 enter

进入

enter image description here