Use the value of another cell in an IF formula calculation

mvrht

New Member
Joined
Dec 9, 2017
Messages
18
I have a simple IF calculation, however the higher/lower calculation of the formula varies so we calculate this.

How can I insert the value of a cell into an IF formula calculation

STANDARD FORMULA
=if(D2<=A2,"Lower","")

REFERENCE A CELL FORMULA
=if(D2"C2"A2,"Lower","")

So always insert the value(operator) held in column C into the formula calculations


https://docs.google.com/spreadsheets/d/1OuijgOYghEHUHTuegUrTf1zmAaUYz1mU99Wq2yOkxQQ/edit?usp=sharing

I have tried some INDIRECT, CONCAT, INDEX, JOIN options with no joy
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Based on your post, I was expecting C2 to contain a random string value, e.g. "<=" or ">" or "=", say.

But you actually have a formula in C2: =IF(D2 < A2,"><a2,"><a2,">=","<=") (which looks to me as if it's round the wrong way)

So C2 is redundant in your later formula - you can just test A2 and D2 directly.

I'm not really clear what your range of possible results is, but my suggested starting point would be:

=CHOOSE(SIGN(D2-A2)+2,"Lower","Same","Higher")

If that's not what you're looking for, perhaps you could post some more examples with the desired results?</a2,"></a2,">
 
Last edited:
Upvote 0
Thanks Stephen.

In a nutshell, I just need to insert the value of C2 into an IF calculation.

So when a form is submitted, we establish whether the customer would like the price to increase or decrease. This static value gets inserted into C2 and is the basis for the calculation we use to notify the customer when their target price is hit.

So just like we would use concatenate(e2,d2) to produce £40. I need something similar to produce =if(D3>=A3... but using the value of C2 to insert between D3 and A3
 
Last edited:
Upvote 0
Perhaps something like this:

D2: =MyResult

where Name Manager defines MyResult: = EVALUATE(Sheet1!C2&Sheet1!B2&Sheet1!A2)

Copy D2 down the column.


Book1
ABCD
1Old priceNew price vs old priceNew priceResult?
22<=1TRUE
32<=2TRUE
42<=3FALSE
52>=1FALSE
62>=2TRUE
72>=3TRUE
82>1FALSE
92>2FALSE
102>3TRUE
112<1TRUE
122<2FALSE
132<3FALSE
142=1FALSE
152=2TRUE
162=3FALSE
Sheet1
 
Last edited:
Upvote 0
Perhaps something like this:

D2: =MyResult

where Name Manager defines MyResult: = EVALUATE(Sheet1!C2&Sheet1!B2&Sheet1!A2)

Copy D2 down the column.

ABCD
1Old priceNew price vs old priceNew priceResult?
22<=1TRUE
32<=2TRUE
42<=3FALSE
52>=1FALSE
62>=2TRUE
72>=3TRUE
82>1FALSE
92>2FALSE
102>3TRUE
112<1TRUE
122<2FALSE
132<3FALSE
142=1FALSE
152=2TRUE
162=3FALSE

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>

Not sure what the Name Manager is here, any chance you could make a copy of that Google Sheets and demonstrate?
https://docs.google.com/spreadsheets/d/1OuijgOYghEHUHTuegUrTf1zmAaUYz1mU99Wq2yOkxQQ/copy?usp=sharing
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,922
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top