Thread: M$ Excel
View Single Post
  #1  
Old October 24th, 2002, 09:02 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default M$ Excel

I am trying to make a spreadsheet to simplify the calculations for weapon damage values. I have already created a function that will calculate the damage at a specific range, based on size, rate, damage ratio, and damage ratio attenuation. I want to create 1 column that is a spread of 20 numbers, as appears in the components.txt file. I want it to calculate the damage value at each range, and I have it doing that. But, I want it to check each value to see if that range number is greater than the maximum range value that I have set. If it is, then that damage value goes to 0. So I think I would need to use an IF statement. It works for the damage at range values greater than the maximum range, but it does not work for all range values within the maximum range. For those values, it outputs the product function as a text string! I do not know why it would do this, or how to fix it. Here is my IF statement:

=IF(Sheet1!K2<n,0,"=PRODUCT(Sheet1!F2*(Sheet1!G2-(Sheet1!J2*(n-1)))*Sheet1!H2)")

The bold n is variable, and I have 20 different colums for this function. It represents the number of the term for the damage at range value. ie: if the damage spread is:

30 25 20 15 10 0 0 0 0 0 0 0 0

Then 20 is the third term, so the n is replaced by 3 in the C column on sheet 2.

I hope that I have explained this sufficiently for those that could help me to be able to understand it. If not, I can post the spreadsheet file.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote