Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi :)
This is exactly the sort of thing that would be best done as a relational database.  

You have many tables each with a specific type of focus.  For example, something like
Table 1 = Weapons
Table 2 = Armour
Table 3 = Character types
Table 4 = Skills and abilities

Then you can have a main table that just looks-up data stored in those tables.  For example line 1 
in Main Table might look roughly the equivalent of

Vorak, weapon1 =  table1 item1, bonus = +2, weapon2 = table1 item5, bonus = +1, armour = table2 
item5, bonus = 0, character type = table 3 item4, skill = table4 item1

So the main table itself contains very little data and so it's easy to process quickly to get to 
the right line.  File size is kept small because data is not being constantly repeated and also 
errors are kept down.  No accidentally making one individual's katana completely useless in 
hand-to-hand as katana would be listed once only and everyone would have the same characteristics 
for the same weapon.  I added the bonus columns just to add a bit of flexibility to account for an 
individual's unique prowess.  

Regards from
Tom :)  



--- On Sun, 22/7/12, Brian Barker <b.m.barker@btinternet.com> wrote:

From: Brian Barker <b.m.barker@btinternet.com>
Subject: Re: [libreoffice-users] Can I populate a whole row in Spreadsheet by importing from 
Database into only one cell?
To: users@global.libreoffice.org
Date: Sunday, 22 July, 2012, 3:58

At 17:35 21/07/2012 -0700, Kuuga Noname wrote:
I want to, in the weapon and armor tables, be able to populate the whole row with relevant data 
simply by selecting an item in the Name columns. For example, if I enter Broadsword in the weapon 
name column I want it to automatically fill the rest of the row with its damage, size, reach and 
so on.

This can be done fairly easily with the VLOOKUP() function.  In your example, I gave the name 
"Weapons" to the array of weapons values on the "Weapon list" sheet.  Then in cell C3 of the 
weapons table on the Equipment sheet (the first row of the Damage column), I entered
=VLOOKUP($A3;Weapons;COLUMN()-1;0)
Then I filled this formula down the column and across the table.

How does this work?  The VLOOKUP() function searches the first column of the Weapons array for the 
value in A3, A4 etc.  When it finds a match, it returns the corresponding value from the same row 
but a different column in the array.  The expression COLUMN()-1 defines this column as one fewer 
than the column containing the formula.  The final parameter - FALSE or 0 - indicates that the 
values being searched in the first column of the array are not necessarily in order and that an 
exact match (or an error condition) is required.

Another thing I want to do, but isn't really necessary, is make the sheet to automatically 
subtract your total bonus skill points as you assign them to skills; I simply can't figure out a 
way to accomplish this.

I'm not exactly sure how you want this to appear.  But you will want to have a cell (or table) 
somewhere with the initial values.  This might be on a separate sheet or even in hidden cells.  
Then your visible cell (or table) for these values will contain a formula summing the assigned 
values and subtracting the result from the original (fixed) value in the other table.  This way, 
the cell(s) will show running totals as points are assigned.

I trust this helps.

Brian Barker


-- For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


-- 
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.