×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Repeating many calcs with Step then SUM

## Repeating many calcs with Step then SUM

(OP)
HI there all experts,

I have a big problem.

Let say:
I have a formula that depends from the value in a cell.

Now I want this equation to be performed for the values in this cell between 2 numbers with some step and all results to be sumarised in another cell.

Can you help?

Zmei

### RE: Repeating many calcs with Step then SUM

zliazmei:

I'm not exactly sure what you want to do, but I interpreted your problem as this:

You have a cell that you want to enter a number into (lets call this cell "A1").  You also have an equation in a different cell that uses the number you entered in cell A1 (call this cell "A2").

Now, if I understand you correctly, you want the equation (in A2) to be calculated if the number entered (in A1) is between two numbers, and not calculated if it is outside of these numbers (If I misunderstood, please correct me).

To do this, you want to use the following format for your equation (in cell A2):

=IF(AND(A1>=1,A1<=20),A1^2,0)

..where I use a lower limit of 1, an upper limit of 20, an equation equal to A1^2, with the result if the conditions are not met being 0.

If this is not what you had in mind, let me know.

jproj

### RE: Repeating many calcs with Step then SUM

Sounds more like a FOR loop to me.

I guess I don't understand while you don't just set up a column with the value range and a corresponding column with the results.  That's precisely what Excel was designed for.

What you're asking for would require a macro.  Alternately, you might think about doing this in Mathcad, Matlab, or TK solver, since the problem setup you describe certainly fits rnage variable calculations in Mathcad.

TTFN

### RE: Repeating many calcs with Step then SUM

Try Thread770-31578 for iterative solutions.  I might be what you need. David

### RE: Repeating many calcs with Step then SUM

(OP)
HI there,

Thanks to all.
I will try to clarify the problem.
Exactly what I need is to solve and Integral of a functon Between 2 values, using the "rectagles method" with acuracy of 0.01.
IrStuff it sounds like For loop for me to but I do not know how to make this.

Thanks again.

Zmei

### RE: Repeating many calcs with Step then SUM

Zliazmei
Try this

trial X       | B1 =IF(ISERR(B13),B2,MAX(B2,B13))*B14
lower limit| B2 = 2
upper limit| B3 = 10
increment  | B4 =    0.01
formula 1  | B5 =5*(B1^2)
formula 2  | B6 =5*(B1+B4)^2
result     | B7 =AVERAGE(B5,B6)*B4
count      | B8 =(B3-B2)/B4
act count  | B9 =IF(B1=B2,0,B10)*B14
new count  | B10 =(B9+1)
prior value| B11 =IF(B9=0,0,B12*B14)
accumulated| B12 =IF(B9<B8,B7+B11,B11)*B14
new X       | B13 =MIN((B1+B4),B3)
reset       | B14 =1

First enter zero in the reset cell
Go to tools|options|calculation iteration=checked #=1(for debugging)
Select your own lower and upper limits and increment.
Write your own formula 1.  Formula 2 is the same with the increment included.
When it's ready, enter 1 in the reset cell and press F9 until it stops.
I used an easy formula for the example so that you can check the value by true integration.
I rushed this off without a rigorous debug so I'm sure someone else can jump in with an improvement!  It's just a matter of choosing the right logic steps to accumulate the value properly. David

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Industry Perspective: Education and Metal 3D Printing
Metal 3D printing has rapidly emerged as a key technology in modern design and manufacturing, so itâ€™s critical educational institutions include it in their curricula to avoid leaving students at a disadvantage as they enter the workforce. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!