Caleb S. Marine
Caleb S. Marine

Reputation: 1

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. to automatically equal the amount for the most recent "S" trans. I can't just treat this as a chart within a chart because the data will be ongoing.

Variable Range Based on Cell Value

Upvotes: 0

Views: 46

Answers (1)

Raunak Thomas
Raunak Thomas

Reputation: 1403

Assuming that there can be only 2 distinct values, i.e. P or S, for this specific problem I would simply put a formula in D2

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

Upvotes: 1

Related Questions