简体   繁体   English

根据单元格值定义可变范围

[英]Defining a variable range based on cell value

I am trying to make a formula that automatically inserts a given value into a cell. 我正在尝试制作一个自动将给定值插入单元格的公式。 The issue is that the value constantly changes so I can't have just one flat reference cell. 问题是值不断变化,所以我不能只有一个平面参考单元。

Example: In the given chart, I want to find a way for the amount for "P" trans. 示例:在给定的图表中,我想找到一种方式来处理“ P”反式交易的金额。 to automatically equal the amount for the most recent "S" trans. 自动等于最新的“ S”交易金额。 I can't just treat this as a chart within a chart because the data will be ongoing. 我不能仅仅将其视为图表中的图表,因为数据将会持续存在。

Variable Range Based on Cell Value 基于单元格值的可变范围

假设对于此特定问题只能有2个不同的值,即P或S,我只需在D2放入一个公式

=if(B2="P",C1,C2)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM