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

OR function

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


Joined: 08 Jan 2009
Posts: 2

PostPosted: Thu Jan 08, 2009 7:08 am    Post subject: OR function Reply with quote

Hi,
im pretty new to using spreadsheets for more than basic tables. What im trying to do is search for a persons name in 1 of 4 columns. Using the following code obtained from a tutorial: =INDEX(TeamSheet_rd9.A5:Q44;MATCH(T(A6);TeamSheet_rd9.E5:E44;0);2+4) I can obtain the row and the data I want. The problem is I have specified the location E5:E44, when its possible for result to be in A5:A44, E5:E44, I5:I44 or M5:M44. What I would like is to be able to search all 4 ranges "at once". I have tried to use: =OR(INDEX(TeamSheet_rd9.A5:Q44;MATCH(T(A6);TeamSheet_rd9.A5:A44;0);2);INDEX(TeamSheet_rd9.A5:Q44;MATCH(T(A6);TeamSheet_rd9.E5:E44;0);2+4)) but this returns #N/A , and yes I know one has 2 and the other has 2+4, that required. Any help would be great.
Back to top
View user's profile Send private message
RickRandom
Super User
Super User


Joined: 27 Jan 2006
Posts: 1082
Location: UK

PostPosted: Sat Jan 10, 2009 12:12 am    Post subject: Reply with quote

The OR function needs things that are either TRUE or FALSE, so if your INDEX functions give something else, the OR will not work.

It will be clumsy but maybe use:

=IF(ISERROR(INDEX(TeamSheet_rd9.A5:Q44;MATCH(T(A6);TeamSheet_rd9.A5:A44;0);2));INDEX(TeamSheet_rd9.A5:Q44;MATCH(T(A6);TeamSheet_rd9.E5:E44;0);2+4);INDEX(TeamSheet_rd9.A5:Q44;MATCH(T(A6);TeamSheet_rd9.A5:A44;0);2))

It will get worse when trying to check more columns.

Maybe if you explain what you are trying to achieve with the INDEX and MATCH, there might be a simpler solution.
Back to top
View user's profile Send private message
DipSta
Newbie
Newbie


Joined: 08 Jan 2009
Posts: 2

PostPosted: Mon Jan 12, 2009 3:36 am    Post subject: Reply with quote

Okay,on 1 sheet I have 4 columns with players names in them. so A has players name then BCD have votes, E has names FGH have votes etc. on a Second sheet i have all players names in 1 column A and votes in BCD. When i enter a votes on the first sheet i want the second sheet to update its votes, so if a vote is in B then it will appear ont he second sheet in B. (1st sheet is round by round, second sheet will hold all votes unformatted). The match is to find the players name in one of the 4 columns containing names and then use index to fill in the votes, player name plus 1 cell for 1st vote upto p+3 for 3rd vote.
The problem i am having is that i can make it search through 1 column and work but each round a players name may change columns so i need to be able to make sheet 2 search all 4 possible columns to find the match then index the votes from it.
I have tried nested IF's with the following code: IF(MATCH(T(A6);TeamSheet_rd9.A5:A44;0);INDEX(TeamSheet_rd9.A5:Q44;MATCH(T(A6);TeamSheet_rd9.A5:A44;0);2);IF(MATCH(T(A6);TeamSheet_rd9.E5:E44;0);INDEX(TeamSheet_rd9.A5:Q44;MATCH(T(A6);TeamSheet_rd9.E5:E44;0);2+4)))
but that returns #N/A
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Mon Jan 12, 2009 4:40 am    Post subject: Reply with quote

Simply test which of the MATCHes returns #NA and if it should really return a number. Matching text-values involves several tricky options such as case-sensitivity and others. See check boxes in menu:Tools>Options...Calc>Calculation.

It pays off to split calculation models into as many steps as possible.
X1: =MATCH(...)
Y1: =INDEX(...MATCH(...)
Z1: IF(ISNA(Y1);...;...)
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
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