[英]How to calculate the mode of an array stored in a single cell in excel?
[英]How to perform an excel calculation on a vector that is stored in a single cell?
我有一個電子表格,每個單元格中都有一個數字矢量(例如{1; 2; 3; 4}),我想執行簡單的計算(例如= median(),= max(),(不涉及VBA))在每個向量上。 Excel以某種方式僅顯示和執行每個向量的第一個值並進行計算。
我如何才能獲得在計算中使用完整矢量的能力(以及可能在圖表中使用)?
我所擁有的:
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 |
+------------+------------+
我沒有用的嘗試是以以下形式輸入值
1;2;3;4 // {1;2;3;4} each will not be excepted as numbers in the calculations
{={1;2;3;4}]} with String+Shift+Enter will be handled like a single number as well.
(1;2;3;4) // =1; 2; 3; 4 // =(1;2;3;4) each result in an error on input ("not a formula")
在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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.