Equation HELP Needed

msqlh

New Member
Joined
May 8, 2008
Messages
18
Hello.
I am trouble creating the an equation to add to my excel spreadsheet. Can you help? I having the most part creating all the following steps into one working equation. This is what I am looking for the equation to do:

Cell information- G2= 38; H2 = 60; J2 = 3

First, take cell G2 subtract from H2 (=G2-H2)

Second, take the total of G2-H2 and divide it by H2 (side note to accomplish, I did change the "Iteration")

Third, if the total of the 2nd step is greater than 2, but less than 3 (which would be 2) subtract 2 from cell J2

Fourth, place the total of the 3rd step into L2

Thanks for your help in advance. If you have any additional questions, please let me know.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I believe the best (if not the only way), would be to use code. Is that an option??
lenze
 
Upvote 0
I believe the best (if not the only way), would be to use code. Is that an option??
lenze

Hello Lenze.
It could be an option? Are you suggesting that I use a Marco? If so, where would I start? Or how would it be accomplished?
 
Upvote 0
Hello Lenze.
It could be an option? Are you suggesting that I use a Marco? If so, where would I start? Or how would it be accomplished?
Yes, a macro and we can start at square 1.
1. How are the values in G2 and H2 and J2 entered?
2. Do you also want this to apply to other rows?

lenze
 
Upvote 0
your third condition conclusion is faulty
Third, if the total of the 2nd step is greater than 2, but less than 3 (which would be 2)

Untrue that the answer would be 2.

If it is greater than 2 AND Less than 3 THEN it has to be a number between 2.01 and 2.999
 
Upvote 0
Thanks Lenze, the numbers are already entered. It's just a matter of performing the task mentioned in my question post. Also, Nbrcrunch was able to catch an error in the third step. Where do I begin with Macro?
 
Upvote 0
After rereading your OP, I think you just need a formula in L2. Something like
Code:
=IF(((G2-H3)/H2>=2)*((G2-H2)/H2<=3),J2-2,"")
If that's not correct, post back and I will look at some code.
lenze
 
Upvote 0
A minor typo in the front, did you fix it...Change the red to H2

=IF(((G2-H3)/H2>=2)*((G2-H2)/H2<=3),J2-2,"")
 
Upvote 0
Edit the typo and try it again. Should be
Rich (BB code):
=IF(((G2-H2)/H2>=2)*((G2-H2)/H2<=3),J2-2,"")

lenze
 
Upvote 0

Forum statistics

Threads
1,203,472
Messages
6,055,612
Members
444,803
Latest member
retrorocket129

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