View Single Post
  #3   Report Post  
Tushar Mehta
 
Posts: n/a
Default

Assuming the values you describe are in cells A1:D1, the formula you
want is:

=MAX(0,D1-MAX(A1,B1))*3+MAX(0,MIN(D1,A1)-B1)*1

The above has been lightly tested.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...

Hi! I am new to the forum, and I love playing with Excel so I might be a
frequent visitor here, I dont know. :)

I have this nifty Excel problem that I cannot solve. I need a formula
that calculates the following for a roleplaying generator:

Value A: Attribute (that decides 1 point or 3 points)
Value B: Old Skill (current value)
Value C: XP Points (that must be spent)
Value D: New Skill (desired value)

Description: In an rpg we are playing you upgrade your Old Skill by
spending XP Points. As long as the skill is lower than your Attribute,
you pay 1 XP per Skill. When you go above your attribute you pay 3 XP
per skillpoint.

I want a formula that allow a player to write his wanted new skillevel
(D) in a cell.

The stylesheet will look at her old skillvalue (B) to determine if the
new value is greater than her old one. If it is, it will determine how
many points must be spent to reach the New Skill and show the result.
The issue is, *that each point above her Attribute (A) is count as '3'
instead of '1'*.

For example, a player have 15 Dexterity (Attribute) and 10 in Dance
(Skill). They want to spend XP to bring Dance up to 20 (Desired Value).
They spend five points to bring the skill up to 15, then 5x3=15 to bring
the skill up to 20. From 1020 with 15 dexterity therefore costs 20 XP
Points.

My greatest problem with my own formula is when the Attribute (A) is
potentially lower than their Current Skill (B), Excel starts to count
negative points ending up in a greater cost than planned. I feel that
my lack of mathskill limit me from finding a way that counts negative
values as "0".


--
JemyM
------------------------------------------------------------------------
JemyM's Profile:
http://www.excelforum.com/member.php...o&userid=26945
View this thread: http://www.excelforum.com/showthread...hreadid=401682