|
|
|
 |
|

October 24th, 2002, 09:02 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
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.
|

October 24th, 2002, 09:15 AM
|
 |
General
|
|
Join Date: Mar 2001
Location: UK
Posts: 4,245
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: M$ Excel
I'm no whizz with excel, but have you tried it without the =PRODUCT and the quotes? When I've used the IF statement, I just put in the formula as the conditional result.
|

October 24th, 2002, 10:08 AM
|
Corporal
|
|
Join Date: May 2001
Location: Sydney, Australia (the 3rd island!)
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: M$ Excel
The quotes are the problem...its forces what's between them to be treated as a string.
ie.
=4*3 gives you 12
="4*3" gives you 4*3
Askan
__________________
It should never be forgotten that the people must have priority -- Ho Chi Minh
|

October 24th, 2002, 10:40 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: M$ Excel
If I remove the quotes and/or the PRODUCT, it tells me that the formula has errors. The formula works fine when not in an IF statement.
[ October 24, 2002, 09:41: Message edited by: Imperator Fyron ]
|

October 24th, 2002, 02:21 PM
|
 |
National Security Advisor
|
|
Join Date: Jan 2001
Location: Ohio
Posts: 8,450
Thanks: 0
Thanked 4 Times in 1 Post
|
|
Re: M$ Excel
Quote:
Originally posted by Imperator Fyron:
If I remove the quotes and/or the PRODUCT, it tells me that the formula has errors. The formula works fine when not in an IF statement.
|
Fyron,
The problem is the equal sign before the PRODUCT. Take out the equals sign there and the quote marks, leave the equals sign before the IF, and your single formula should work fine.
code:
=IF(Sheet1!K2<n,0,PRODUCT(Sheet1!F2*(Sheet1!G2-(Sheet1!J2*(n-1)))*Sheet1!H2))
Geoschmo
[ October 24, 2002, 13:23: Message edited by: geoschmo ]
__________________
I used to be somebody but now I am somebody else
Who I'll be tomorrow is anybody's guess
|

October 24th, 2002, 09:07 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: M$ Excel
Thank you Geo! Is there anything you don't know? (hehe, that rhymes!  )
Thanks to everyone else that offered solutions too.
|

October 24th, 2002, 10:37 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: M$ Excel
New question:
I want to have 1 cell that has the damage at range line from components.txt in it. eg:
20 18 16 14 0 0 0 0 0 0 0 0 0 0 0 0 0
I have the damage at each range calculated in a separate cell. How do I get 1 cell to make a list of numbers based off of those cells?
|

October 24th, 2002, 11:36 PM
|
 |
National Security Advisor
|
|
Join Date: Jan 2001
Location: Ohio
Posts: 8,450
Thanks: 0
Thanked 4 Times in 1 Post
|
|
Re: M$ Excel
=CONCATENATE(A1," ",B1," ",C1," ",D1)
__________________
I used to be somebody but now I am somebody else
Who I'll be tomorrow is anybody's guess
|

October 25th, 2002, 12:51 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: M$ Excel
Ok, thanks!
|

October 25th, 2002, 01:19 AM
|
Second Lieutenant
|
|
Join Date: Mar 2001
Location: Elk River, MN, USA
Posts: 472
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: M$ Excel
I've had the same problem several times, and never did get it to work. I had to go around it by using two steps.
Place =PRODUCT(Sheet1!F2*(Sheet1!G2-(Sheet1!J2*(n-1)))*Sheet1!H2) far off to the right like in the BA2.
Then use =IF(Sheet1! K 2 < n,0,BA2 )". equation was creating a HTML tag, had to put some extra spaces in there
There should be a way to use the entire equation in one step, but I haven't been able to get it to work. As a precaution, there are several other of the formula's in excel that cause the same difficulties.
[ October 24, 2002, 12:26: Message edited by: Atraikius ]
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|