I do not know ho whether many of you have ever had this problem but as I was working on quite a lot of excel data, transforming it for placing in a database using local in file, you will occasionally find that there is data in excel that you may need to represent as a number to enable table linking and foreign keys. For the longest time, I was converting data for foreign keys either manually or using an application of database procedure to create these foreign keys.
This worked fine until I got many excel sheets that were not similarly formatted. So, instead of writing a procedure for each excel sheet being imported, I found a simple was of searching text in a cell and help create a ready to go sheet for importing to the database.
The excel if statement I used is as below
The above statement will search the cell A1 for the string value “dog” (the asterisks make sure that excel searches and finds the sting even if there are no spaces before or after the search parameter “dog’) and return TRUE if found of FALSE if not found. The values for TRUE and FALSE can of course be replaced with whatever values you may need to make things work for you.
I hope this has been of help. And as with nearly everything in the computing world. I know there are other ways and maybe even better ways of doing what I have mentioned above. So, please do comment or suggest more ways below.Share