Is there a way in Excel/VBA to calculate the width of a text string (in points or inches) with a specific font/font size/font attributes? Right now I have to use a static character count which assumes worst- case character widths for the font (Arial 8 point) but leaves unused whitespace to the right when the text string uses narrow characters.
I am trying to found or create a formula that will display cell width to the decimal place.
I can use the formula Cell("width"), but it rounds to the nearest integer. I need to display the decimals. For instance, if the actual column width is 8.43, the Cell("Width") formula will display 8. I need it to show 8.43.
Something has X views, 10,000 for this example. I want:
1) The first 100 views to be worth 3 points each (=300 points) 2) The second 100 views to be worth 2 points each (=200 points) 3) The third 100 views to be worth 1 point each (=100 points) 4) Any view therafter to be worth 0.75 of a point (in this case, 9,700 views times 0.75 = 7,275) points.
How would I create a formula like that (without having to actually divide up the views into four groups and do the separate calculations?)
I am trying to calculate the duration between two times on different days.
For example - I want to know the number of days/hours/minutes/seconds between 25th Feb 2009 20:00 & 27th Feb 2009 22:00.
I am sure that the key is how I enter the data into the cells and how those cells are formatted, I just cannot get Excel to see that the times are on different days. At the moment my data is in a raw format with times in one column and dates in another.
I am updating a sports competition ladder. There are two aspects to compiling the table I would like to automate but have been unable to find out how via the excel documentation.
The aspects are.
1. When a team loses by a margin of seven points or less below the total points scored by the winning team then the team is awarded a single "1" bonus point that contributes to their overall competition points tally. 2. When a team scores four tries or more they are likewise awarded a bonus point.
I require formulas that will automatically calculate the bonus points into a cell.
Situation One cell 1 = Points For (eg. 17) Cell 2 = Points Against (eg. 24). In this instance the team did not win. They scored 17 points and the winning team scored 24 points. Therefore the team lost but lost by seven points and is therefore entitled to one (1) bonus point. SOLUTION NEEDED - I need a formula that will calculate whether cell 2 is seven or less than cell 1, and if so automatically place a total of "1" in cell 3.
Situation 2 Cell 1 = Tries Scored (eg. 5) In this instance the team has scored five tries. They have scored more than four tries or more and is therefore entitled to one (1) bonus point. SOLUTION NEEDED - I need a formula that will scan the number in cell 1. If this number is 4 or more, then a total of "1" should be automatically placed in Cell 2.
I have looked into the excel help but to no avail and the search terms are so broad it was a nightmare trying to search the forums.
I'm creating an (English) football predictions competition for me and my family.
One problem that has stumped me is how to get the scores based on the 'home' & 'away' score predictions.
The rules are: If I predict the correct exact result I get 3 points. I want to add another 'rule' whereby if I predict the correct winner, I get 1 point. Incorrect predictions get 0 points. I don't know how to do this using a formula.
I have a set of task descriptions that I am attempting to trend on. Some of these (Column B) have the customer's name added to the description; others do not. I need to be able to make a list of task names (ColumnA), removing the name from the text string.
The formula I am using is [=LEFT(B3,FIND("for",B3)-2)].
The problem I am having is when the description does not contain the "for" built into the formula, I get "VALUE" error. What adjustment can I make to the formula to pull over the Description if the "for" does not appear in the text string?
I am having a problem importing fixed width text files with VBA. I created a user form for a dept to import a number of reports we get as text files into Excel. I imported each line into 1 cell (Column A) in Excel and then used mid functions to split out the columns. Everything works fine on my PC. However, when I use other PCs to import the same files (either off the same shared drive or the PC hard drive) the columns are not splitting in the correct places. Does anybody know what could cause this. Since the columns are splitting based off a fixed number of characters, I'm assuming Excel is somehow distorting a character count while opening the text file. I did notice that if I try to import text files saved on one of our shared drives, they do not import correctly on my PC either. However, if I copy and save the same text file to any of the other shared drives or my PC, it imports with no problems.
How to insert the column dividers manually--for importing a fixed-width text file into excel? The files I'm having to import consist of dozens and dozens of columns.
I am looking to import data in text file to Excel sheet. Here is the main catch - All the data are not of fixed length and are in multiple lines as in the example below.
Text File: ID001 Dr Dang 01012011 Male USA Married 123
Below is how I expected the data extraction in Excel: ColumnA ColumnB CardID ID001 Name Dr Dang DOB 01012011 Sex Male Country USA Status Married Pin 123
how to automatically set a text box size to display text contained by right-clicking the textbox and put a check in the auto-size box under "Alignment".
However I would like to set the widht of the text box and automatically adjust the height according to the number of lines of text. Is this possible by VBA code or othe means?
I need to fixed width-text to column macro and found a reply in the forum.
However, when I apply the macro, the result of zeros in front of figures disappear since the format of value in splitted column doesn't predefined as text
e.g. sample text to split to column: 000122042009ABCDEFG00567
Required result: 0001|22042009|ABCDEFG|00567
when running below macro; result shows: 1|22042009|ABCDEFG|567 (Beginning zeros figures of the first and last column disappear)
I need to extract text from a cell between 2 predetermined characters. Below find all possible cases and what result (after extraction) should look like:
Basically I need to extract numbers between (to the left) o or u and to the right + or -. The string ends always with 3 numbers if it. I have also attached excel file of these two rows for your convenience.
Is it possible to adjust a cells' column width without the whole column width changing? EXAMPLE...I'm looking to lock rows 1-41 at certain column widths and change the column width as needed from rows 42 and below.
I have 2 columns (A and B) of text, A and B that needs to be turned into numbers in column C. The text in column A can also occur in column B and vice verse. There can also be 2 or 3 values in column B, there is no "," to separate the values only spaces. Every text name has a value (they are explained in the file but not included in original files). If there is text in both columns it has to add the value for each text. I need to get column C calculated by using VBA. Column C is empty from the start and the rows can be +500.
In cell A5 (please see the excel attached) I have a weighted formula that is supoosed to return a final result based on the drop down from cells B5 to V5. Drop downs give the option of choosing a value. Everything is going fine as long as you select a value (5, 3 or 0).
In cells H5, J5, K5, R5, S5, U5 there is also the option of choosing NA. I am trying to get the formula to calculate NA as being equal to 5. Basically, if for the respective parameter someone choses NA, the final result in cell A5 should not be influenced.
If all the parameters are 5 and only one has NA (any of the cells H5, J5, K5, R5, S5, U5), the final result (in cell A5) should be 100.
The same applies if all parameters are 5 & more than one cell or all the cells that have the NA options (H5, J5, K5, R5, S5, U5) are NA.
On the attached spreadh sheet I have production costs that I wish to calculate. There are certain courses that are a constant each month and they are input via a data validation list, however there will be courses that are run that are not on this list.
on the cell with 'Other' I want to total the costs for the courses that exclude the normal monthly courses.
Ive managed to use the formula below to exclude certain text but I cannot do it for multiple keywords, or maybe there is a simpler formula. =SUMPRODUCT(--(G4:G31>0),L4:L31,--ISNUMBER(FIND("Suicide",G4:G31)))
I have thousands of lines in a txt file and would like to total the sum of a field. here are the few lines in the txt file.
I would like to calculate the LPG_Amt for each of the Company_code and the count of number of lines for each of the Company_code. Request the members to help me with a vba code that could run in an excel file and give the output in excel.
Core ValueCurrent Pricenew Price a 400 b 600 c 300 d 300
If core value = a then new price should be current *2%, if core value=b, then new price should be current price times 2.2%, if core value = c than new price should be current price times 2.5% and if core value=d, than new price should be current price times 3%?
also would i be able to do a formula if core value is either a or b, than new price should be current price times 2% and if core value is = to c or d, than new price should be current price *3%?
I am compiling data from several different, variable, worksheets. I am using concatenate to add the name of each worksheet into a formula to pull the appropriate data.
However, it is returning the text of the formula instead of the results of the formula. How can I make it calculate the result instead of simply displaying the formula text?
I have a list of YES or NO answers in a sheet. I want to calculate the % of YES in the list. E.G. if there are 100 cells in total and 25 of them say YES and the remaining 75 say NO, the percentage should be 25%.
Essentially the user will enter their responses from a drop down list (assigned to about 30 textboxes in the userform: named txt1code, txt2code, txt3code....txt30code) and at the bottom of the userform the number of responses ('Yes') will be counted in real time and displayed in a textbox. (without using a command button)
For example:
The possible responses in the textboxes are 'Yes', 'No', 'Not Applicable', ''.
Yes = 1
I'd like the calculation to ignore No's, Not Applicables and ; however, count all the 'Yes' responses.
If there are 17 'Yes' responses, 10 'No', 2 'blanks', and 1 'NA' in the form, the Totals textbox will display '17'. As the user is entering information-"Yes" responses only (added or deleted), he or she can visually validate that the number of 'Yes' responses has changed.
Is a real-time calculation possible in a userform?
I want to calculate the average of a range...if it meets a certain text criteria.
For example, if the product is a "Course", then take the average of pages all those courses together.
ProductNumber of PagesExam316Course46Exam232Course32Exam245Course53Exam155Course246Exam118Course154Exam82Course434Exam80Average # of Pages for Courses = Average # of Pages for Exams =
Got two spreadsheets that should be identical, and in both the column widths ARE identical - when you look at the no. of Pixels. However, the other width is different. So what's the relationship between width and pixels? Is this difference to be expected?