OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Complex Question, hope you can help with this formula

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
braindeadbidule
Newbie
Newbie


Joined: 28 Jul 2010
Posts: 2

PostPosted: Wed Jul 28, 2010 1:04 am    Post subject: Complex Question, hope you can help with this formula Reply with quote

'AttPriority' accepts values from 1 to 6, each representing the order a series of options
1- A, B, C
2- A, C, B
3- C, B, A
4- C, A, B
5- B, A, C
6- B, C, A

I have 3 tables, each with a cell having the respective formulas

=(IF(OR(AttPriority=5;AttPriority=6);BQ2;IF(OR(AttPriority=2;AttPriority=3);BT2;IF(OR(AttPriority=4;AttPriority=1);BW2))))

=(IF(OR(AttPriority=3;AttPriority=4);BQ2;IF(OR(AttPriority=1;AttPriority=6);BT2;IF(OR(AttPriority=2;AttPriority=5);BW2))))

=(IF(OR(AttPriority=1;AttPriority=2);BQ2;IF(OR(AttPriority=4;AttPriority=5);BT2;IF(OR(AttPriority=3;AttPriority=6);BW2))))

'BQ2' currently equals 7
'BT2' currently equals 5
'BW2' currently equals 3

My goal is to have a formula that calculates one of the formulas above, minus a colum of variable numbers.

Ex:
=(IF(OR(AttPriority=5;AttPriority=6);BQ2;IF(OR(AttPriority=2;AttPriority=3);BT2;IF(OR(AttPriority=4;AttPriority=1);BW2))))-SUM(BR18:BR20)

Thing is, at this time, the formula works perfectly except when the 'AttPriority' refers to 'BQ2' (value: 7). When the value is the greatest value of the 3 available values, it stops calculating it, and gives me only the equivalent of 0-SUM(BR18:BR20)

I really do not know what to do to solve this problem. Help?

Thank you!
Back to top
View user's profile Send private message
Jens S
Power User
Power User


Joined: 26 May 2008
Posts: 87
Location: Denmark

PostPosted: Wed Jul 28, 2010 6:35 am    Post subject: Reply with quote

Hi

I don't like these complex if-formulas, sometimes they end op with nothing.
Try CHOOSE:
=CHOOSE(AttPriority;BW2;BT2;BT2;BW2;BQ2;BQ2)
=CHOOSE(AttPriority;BT2;BW2;BQ2;BQ2;BW2;BT2)
=CHOOSE(AttPriority;BQ2;BQ2;BW2;BT2;BT2;BW2)

Jens
Back to top
View user's profile Send private message
braindeadbidule
Newbie
Newbie


Joined: 28 Jul 2010
Posts: 2

PostPosted: Wed Jul 28, 2010 12:08 pm    Post subject: Reply with quote

Thank you Jens,

I have replaced the formula with CHOOSE, but the problem remains...

2 examples with different 'AttPriority' variables



The biggest orange square, the one on the left, is 'AttPriority'
As you can see, whichever table is assigned the value '7' doesnt substract the "C" column data from the Orange total (3/5/7)

The formulas are the same for each

In the first table, with 'AttPriority' value of 5
The Orange Cell in BI16 is =CHOOSE(AttPriority;BW2;BT2;BT2;BW2;BQ2;BQ2)
The Yellow Cell in BI16 is =BG20-(SUM(BR18:BR20))

But the forumula seems to ignore BG20 in the forumula, calculating it only as =-(SUM(BR18:BR20))

...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group