.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

The Star and the Crescent- Save $8.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old October 24th, 2002, 09:15 AM
dogscoff's Avatar

dogscoff dogscoff is offline
General
 
Join Date: Mar 2001
Location: UK
Posts: 4,245
Thanks: 0
Thanked 0 Times in 0 Posts
dogscoff is on a distinguished road
Default 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.
Reply With Quote
  #3  
Old October 24th, 2002, 10:08 AM

Askan Nightbringer Askan Nightbringer is offline
Corporal
 
Join Date: May 2001
Location: Sydney, Australia (the 3rd island!)
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Askan Nightbringer is on a distinguished road
Default 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
Reply With Quote
  #4  
Old October 24th, 2002, 10:40 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 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 ]
__________________
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
  #5  
Old October 24th, 2002, 02:21 PM
geoschmo's Avatar

geoschmo geoschmo is offline
National Security Advisor
 
Join Date: Jan 2001
Location: Ohio
Posts: 8,450
Thanks: 0
Thanked 4 Times in 1 Post
geoschmo is on a distinguished road
Default 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
Reply With Quote
  #6  
Old October 24th, 2002, 09:07 PM
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 Re: M$ Excel

Thank you Geo! Is there anything you don't know? (hehe, that rhymes! )

Thanks to everyone else that offered solutions too.
__________________
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
  #7  
Old October 24th, 2002, 10:37 PM
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 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?
__________________
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
  #8  
Old October 24th, 2002, 11:36 PM
geoschmo's Avatar

geoschmo geoschmo is offline
National Security Advisor
 
Join Date: Jan 2001
Location: Ohio
Posts: 8,450
Thanks: 0
Thanked 4 Times in 1 Post
geoschmo is on a distinguished road
Default 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
Reply With Quote
  #9  
Old October 25th, 2002, 12:51 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 Re: M$ Excel

Ok, thanks!
__________________
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
  #10  
Old October 25th, 2002, 01:19 AM

Atraikius Atraikius is offline
Second Lieutenant
 
Join Date: Mar 2001
Location: Elk River, MN, USA
Posts: 472
Thanks: 0
Thanked 0 Times in 0 Posts
Atraikius is on a distinguished road
Default 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 ]
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:43 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.