The Book-keepers Forum (BKF)

Post Info TOPIC: Automatically cateogrising in spreadsheets.


Veteran Member

Status: Offline
Posts: 48
Date:
Automatically cateogrising in spreadsheets.
Permalink Closed


 

 

This is for Libreoffice or openoffice.

I want to import data into a spreadsheet and then be able to add a column that will automatically tag or label that column based on the text in another column. For instance If B2 has the words "Shell" then D2 has the word "Gasoline". If B3 has the words "McDonalds" then D3 displays the word "Fast Food". Once an association is chosen, then it makes the same choice throughout the sheet.

Something like VLOOKUP maybe?

Thanks

 

Edit:  Or is there a bookkeeping template that has this in it ?



-- Edited by Soar on Thursday 22nd of August 2013 09:25:07 AM

__________________


Forum Moderator & Expert

Status: Offline
Posts: 11981
Date:
Permalink Closed

Exactly like a Vlookup.

I don't use openoffice so you will need to find the equivalent but personally I would :

- Set up a macro to grab another spreadsheet and import it into a worksheet.

- The same Macro should copy the column with the information that you need to column B of the working spreadsheet.

- A seperate worksheet should hold your Vlookup database

- Column D should be your Vlookups.

- You may need to do a refresh (shift F9) on completion of the Macro to populate column D.

I would also be prone to tieing the macro to a custom button in the spreadsheet. Possibly also make the shift F9 part of the macro rather than separate (just use the record function to build our macro in the first place).

In future you will always need to import data into the same feeder spreadsheet in order for the Macro to work so it may also be a good idea to get the Macro to save a backup of the original spreadsheet as part of the process. (#1)

Hope some of the above proves useful.

Shaun.


#1 something like :
sFile = "monthly extract" & "" & Format(Date,"mmm yy") & ".xls" ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\My Documents\Extract backups\" & sFile

Play around with the above (espechially the save path) as necessary but just wanted to show how to auto add the date to the backup without changing the macro.

__________________

Shaun

Responses are not meant as a substitute for professional advice. Answers are intended as outline only the advice of a qualified professional with access to all relevant information should be sought before acting on any response given.



Member

Status: Offline
Posts: 18
Date:
Permalink Closed

This seems to work

Search text B2

formular in D2

=INDEX($E$1:$E$2,MATCH(1,COUNTIF(B2,"*"&$D$1:$D$2&"*"),0))

Explaination
=INDEX(Tag Column,MATCH(1,COUNTIF(B2,"*"&Lookup Column&"*"),0))

Column D has Column E has
Shell                 Gasoline
McDonalds         fast food

formular has to be entered as array formular Ctrl + Shift + Enter

edit- column spacing didn't work

 



-- Edited by ChrisA on Thursday 22nd of August 2013 06:32:19 PM

__________________

Chris



Veteran Member

Status: Offline
Posts: 48
Date:
Permalink Closed

yes thanks!

__________________


Veteran Member

Status: Offline
Posts: 48
Date:
Permalink Closed

stuck again.. I can make vlookup work if it is searching for an exact complete phrase but how to make the vlookup search for a phrase found anywhere in a cell?

So it will pick out Tescos from "Birmingham Tescos 8.50 etc etc"



__________________


Forum Moderator & Expert

Status: Offline
Posts: 11981
Date:
Permalink Closed

Hi again,

Replace your standard lookup with this :

=IF(ISERR(SEARCH("Tescos",A1)),"",VLOOKUP(A1,your lookup database))

the your lookup database is of course your normal Vlookup bit.

HTH,

kind regards,

Shaun.

 



__________________

Shaun

Responses are not meant as a substitute for professional advice. Answers are intended as outline only the advice of a qualified professional with access to all relevant information should be sought before acting on any response given.



Forum Moderator & Expert

Status: Offline
Posts: 11981
Date:
Permalink Closed

Or, simpler one,

=VLOOKUP("*"&Tescos&"*",your database, col index, range)

 

 



__________________

Shaun

Responses are not meant as a substitute for professional advice. Answers are intended as outline only the advice of a qualified professional with access to all relevant information should be sought before acting on any response given.



Veteran Member

Status: Offline
Posts: 48
Date:
Permalink Closed

but how do i do this for multiple phrases, i want to search thru each transaction description, and categorise it, so need to do it for tescos, mortgage, petrol etc..

atm i am using this

=VLOOKUP(C6,$M$2:$O$20,3,0)

but only works if i list in the M column the exact and complete transaction description in the C column.


__________________


Forum Moderator & Expert

Status: Offline
Posts: 11981
Date:
Permalink Closed

surely each phrase is going to need its own column.

Of course, taking that approach what would you do where you have an entry where (for instance) you buy petrol from Tesco? The information would appear in two columns.

Do you want to send your spreadsheet as is to shamus.bkn@virginmedia.com so that I am able to visualise the issues better (doesn't sound as though the spreadsheets too big).

Just take the company / individuals name off the version that you send me.

I'm a bit busy at the mo but would certainly be able to turn it around this evening.

kind regards,

Shaun.

p.s. for anyone else. once we have a fix I will post the answer back on here again (without the data of course).





__________________

Shaun

Responses are not meant as a substitute for professional advice. Answers are intended as outline only the advice of a qualified professional with access to all relevant information should be sought before acting on any response given.



Veteran Member

Status: Offline
Posts: 48
Date:
Permalink Closed

That is very kind offer

I have mailed it

__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.

Tweet this page Post to Digg Post to Del.icio.us
Members Login
Username 
 
Password 
    Remember Me  
©2007-2024 The Book-keepers Forum (BKF). All Rights Reserved. The Book-keepers Forum (BKF) is a trading division of Bookcert Ltd. Registered in England Company Number 05782923. 2 Laurel House, 1 Station Rd, Worle, Weston-super-Mare, North Somerset, BS22 6AR, United Kingdom. The Book-keepers Forum and BKF are trademarks of Bookcert Ltd. This forum is a discussion forum only. There will usually be more than one opinion to any question and any posting should not be viewed as a definitive solution. No responsibility for loss occasioned to any person acting or refraining from action as a result of any posting on this site is accepted by the contributors or The Book-keepers Forum. In all cases, appropriate professional advice should be sought before making a decision. We reserve the right to remove any postings which are offensive, libellous, self-promoting or engaged in covert marketing. We will not notify users of removals. The views expressed in the forum posts are those of the individual and do not necessary reflect or agree with those of The Book-keepers Forum. Any offensive or unsuitable posts will be removed by the moderators. Any reader of this forum can request for a post to be looked into by sending an email to: bookcertltd@gmail.com.

Privacy & Cookie Policy  About