I am currently working on reading a pdf file and extracting the contents of a pdf file.
However, three particular (invoice value, tax, total amount payable) are coming up as one concatenated field.
So if the pdf file has invoice value as 1000, tax as 118 and amount payable as 1118, i get 1,0001181,118 as a field.
Is there any way to create a special delimiter where i check the number of digits after a comma as a rule?
I found a very roundabout way of doing this. The best solution I could come up with was to create a lookup table on the number of digits that a particular combination of numbers would end up with (for instance, if there are 14 digits, it means that invoice value had 5 digits, tax had 4 digits and final amount had 5 digits) and so on and so forth.
Based on the number of digits, I was then able to determine what the final amount was, then back-calculate what the tax and invoice value is.
Very crude method but i suppose it worked
Related
I have a list of addresses from which I need to extract the last sequence of numbers (zip code). I'm looking for a general expression from which I can extract the zip codes from addresses from all over the world. I would have to tweak the expression in order for it to work for each country, or for a group of countries, I assume.
I'm trying to write a formula in excel that can recognise the last digit in a string, and from that, extract the numbers immediately before that last digit and stoping whenever it reaches a non-integer. Below I have an example of an address and the formula I've come up with (in E26), but I'm looking for something more compact:
National Institute of Pharmaceutical Education and Research (NIPER), Phase X, Sector 67, SAS Nagar, Punjab, 160062, India.
=MID(E26, MAX(IF(ISNUMBER(VALUE(MID(E26,ROW(INDIRECT("1:" & LEN(E26))),1))),ROW(INDIRECT("1:" & LEN(E26))))+1)-6, 6)
The first part of recognizing the last digit is working fine, the problem is to recognize the beggining of the sequence, at least in cases where there's also street numbers within the string (such as in this case). This is why I'm subtacting -6 to the position where the last digit was found, since I know the lenght of the zip code in this particular country. However, it may not be the case for all countries.
Plus there are cases, where there's a space between the sequence such as: 160 062. Also, they won't always have delimeters that I could use to extract the zip codes, hence, the reason why a need an algorithm for this.
I was wondering if there's a nitter way to do this? I would be open for VBA. Thanks for your help!
Best regards,
Antonio
I have a free-form text custom CRM field that is displayed as time that I would like to convert to a number in order to do basic arithmetic operations. The field is called {actualwork} and displays like this, 3:00. I want to divide it by a decimal number field called {custeven10} and display it in percent.
By using TO_NUMBER and SUBSTR I can convert the text to a number but the number of hours can be higher than a single digit so I don't know how to use the SUBSTR command to split my field. Right now I'm using this command but it only uses the first digit of the string.
TO_NUMBER(SUBSTR{actualwork},1,1))/{custevent10}
Does anyone know how I could separate the characters before and after the ":" into a two strings? Thank you for your time.
I used this formula to transform the text into number and separate the minutes and the hours:
(TO_NUMBER(SUBSTR({actualwork}, 1, LENGTH({actualwork})-3))+TO_NUMBER(SUBSTR({actualwork}, LENGTH({actualwork})-1,2))/60)/{custevent10}
On a daily basis I need to load data to one of our systems. However Excel deletes the previous zeros in front of the contractor IDs. So i have to add THREE zeros manually. I normally use the CONCATENATE function however now the IDs are coming differently so some IDs now only need to have TWO zeros added.
example:
ID
911111
I use concatenate to make it look like:
000911111
I came up with the IF formula that detects if the ID starts with a number NINE, to concatenate TWO zeros and if not, then to add THREE zeros.
example:
=IF(LEFT(A32,1)="9",CONCATENATE("00",A32),CONCATENATE("000",A32))
Now I want to create this formula as a custom defined so I do not have to write down the formula ever time I work on the data every day.
Any suggestions I will really appreciate.
In addition to the formatting responses provided in the comments, you could use the RIGHT function to cut off the leading zeroes to the appropriate amount.
For example, assuming A1 holds a string of numbers, between 0 & 9 digits long. We can create text representing a 9 digit string, with as many leading zeroes as necessary, as follows:
=RIGHT(REPT("0",9) & A1,9)
REPT("0",9) tells Excel to repeat the character "0" 9 times. It then tacks on whatever text is in A1. Then it takes only the rightmost 9 characters of the concatenation.
I generally would recommend the Formatting options noted in those comments, unless you need the text to be 9 characters for other formula purposes.
I have a very large spreadsheet where I need to replace a word in one column with text from another on a large scale.
I need to replace one word (in this case it is [Rate]) with information from a different column.
ex: Fixed rate of [Rate] per kilowatt hour.
finished product: Fixed rate of 0.0652 (number found in different column) per kilowatt hour.
Is this possible on a large scale? There is 800 something of these that I need to update but my work application is rather slow and if I can streamline this it will save me hours of time.
Use the substitute function:
The information page is found at:
Syntax
SUBSTITUTE(text,old_text_or_reference,new_text_or_reference,inst)
Text:the text (as string) or reference in which you want to replace
Old_text:Text to be replaced in the string
New_text:Is the text or reference you want to replace old_text with.
inst: Not a compulsory variable. Is which consecutive number of the occurrence of the old_text that you want to replace.
http://office.microsoft.com/en-nz/excel-help/substitute-function-HP010062578.aspx
In my country any bank account number has a secondary key which named SHEBA, and there is formula to calculate the SHEBA from account number.
For example if my account number is 801-800-125954-1, the SHEBA of this number is IR0008010080000125954001.
As you can see, changing the account number to SHEBA has been done by putting a handful of zero between account number's digits (however It's not always so simple).
So, I want write formula in Excel that can put zero - or any other digit - between our Number of customer accounts.
I mean, write function in which it's input is a number and output is same number plus some another digit between number
If you can split your string after each '-', you can pad each one with the appropriatz number of '0'.
Se "Add leading zeroes/0's to existing Excel values to certain length" (using TEXT)
801 would become "IR"+TEXT("800","000000")
Since you only posted one number and one SHEBA, it is a bit hard to establish a pattern, especially if, as you say "It's not always so simple".
You can use one formula to get from your number to your SHEBA
="IR000"&SUBSTITUTE(A1,"-","00")