excel - How can I create a list of numbers that is like the following?
问题描述
I want to create a list of number like this in Excel, in separate cells:
(column B);
1
1
2
1
2
3
1
2
3
4
.
.
.
.
If you can't see each number is sequences from one up to the number your on.
解决方案
仅使用公式,不使用 VBA:
在 B 列中:
1 | 1
2 | 1
3 | =IF(B2-MAX(B$1:B1)<1,B2+1,1)
然后填写该公式
如果您只想要一个独立的公式(不引用其他单元格),您可以使用这个更强大的公式在 term n = ROW() 处评估三角形序列:
=IFERROR(ROW() - COMBIN(INT((1+SQRT(8*ROW()))/2), 2),1)
(IFERROR 部分只处理第一项,它试图评估 COMBIN(1,2) )
推荐阅读
- python - 不要在 Python 中计算矩阵 1xm 和 nx1(不是 NumPy)
- kubernetes - prometheus PQL 获取自长时间以来所有 API 调用 ot kube api 服务器的总数
- pointers - 符号表中“删除”的策略实现为具有“紧密嵌套范围规则”的语言的哈希表
- python - 代码没有按照我想要的方式工作(python)
- reactjs - ReactJS - 在 iPhone 框架中呈现我的网站
- python - 使用 FastAPI 的嵌套 Pydantic 模型返回错误:必填字段 (type=value_error.missing)
- c++ - 为什么我会收到错误“malloc():损坏的顶部大小”?
- javascript - 使用 axios 在单独的文件中上传文件的进度
- javascript - 历史推送是按两次相同的键
- apache-kafka - 无法在 Azure 事件中心启用 Kafka 功能