# Converting Formula To UDF

Jul 10, 2008
creating a formula that would convert a string like 63008 (Mdyy format) to a format that Excel can read as a date

=IF(LEN(I2)=5,DATE(20&RIGHT(I2,2),LEFT(I2,1),MID(I2,2,2)),DATE(20&RIGHT(I2,2),LEFT(I2,2),MID(I2,2,2)))

In other words IF(the length of the cell value is 5, parse the date this way, otherwise parse it another way)

If I2=63008, this would output 6/30/2008

I want to convert this to a function since that formula is rather tedious to type out, but I am new to Excel programming

View 9 Replies
ADVERTISEMENT
Jun 9, 2014

I need a formula that converts time in the format of hh:mm to 00:mm. I only want the minutes.

View 4 Replies
View Related
Nov 10, 2011

I have a working formula that I want to convert to vba code... I only want to store the formula result in each cell in my range, not the formula itself. It is an ARRAY formula (entered with CTRL + SHIFT + ENTER) and it would be ideal if it could follow R1C1 format to keep it relative for each cell.

Here is the formula as it's entered in my spreadsheet:

=INDEX(PerfMetricTbl!$U$2:$U$250000, MATCH(1, (PerfMetricTbl!$A$2:$A$250000=$A2)*(PerfMetricTbl!$D$2:$D$250000=$D2)*(PerfMetricTbl!$Q$2:$Q$250000=$Q2)*(PerfMetricTbl! $R$2:$R$250000=Z$1), 0)))

I am not super familiar with using INDEX/Match combos which is why I am struggling with this one...

The end result should be:

For each cell in myRange

cell.value = 'Formula result here

Next cell

-OR-

If possible to fill the range in one step:

myRange.value = 'Formula Result Here, utilizing R1C1 relative reference... (this may be a stretch given the range is 55krows x 18 columns)

The problem at hand is I need to fill a range of approx. 999,000 cells with values and the values are a VLOOKUP with 4 matching criteria. So returning the value from Col U on my LookupTbl when the criteria in Col's A, D, Q, and R are an exact match to my values in A, D, Q, and Z:AQRow1.

View 2 Replies
View Related
May 28, 2006

I have an excel work book where in one page (sheet1) contains formula types to be used based on a code. and in the other page (Sheet 2) when I enter the code I need it to get the formula from 1st page and then do the calculation in the second based on the code. Ex : Sheet 1

Code Formula

0 Cell A * CellB

1 Cell B - Cell A*5%

2 (Cell A + Cell B)*10%

In Sheet 2

Cell A B C D ..........

Price(A) Units(B) Code Amount

100 5 0 500 (100*5)

100 5 1 answer (5 - (100*5%)

100 5 2 answer (100+5)*10%

I hope you got the picture. The problem is I'm not sure how to take only the formula from 1st sheet and then use it in the 2nd sheet to do the calculation.

I wont mind using a form for this even.

View 7 Replies
View Related
Apr 11, 2014

I have a column with names, where i need the 1st letters of the Names to be displayed in CAPS. If its a Single letter also, the same should be displayed in CAPS

View 2 Replies
View Related
Jan 13, 2014

I have two sheets, the first called 'AF' and the other called 'POR'. For one of the columns in the 'AF' sheet I used the following formula - VLOOKUP(B2,POR!$A$2:$A$111254,1,FALSE) to retrieve a string consisting of 7 numerical digits (Ex. 4678451). Now if I want this result of 7 digits in the same 'AF' sheet to be converted to the word "YES" - how do I achieve this? (All the 7 digits numbers are different or unique). Is there some sort of REPLACE command I use here or some other means?

View 2 Replies
View Related
Jan 27, 2009

I have whole bunch of formula's added to cells by code. So far so good. How could I then set in macro code that the result is stored in cell as value rather than formula? Now when I go to cell you can see =PIBVSearch(.... yadda yadda yadda in the field above.

I would prefer to change it so that content of cell changes to it's value so there's no formula visible(and above all not stored to harddisk(LOTS of disk space lost. Whole project started to trim down 269Mb excel file into smaller piece! I don't want it to go back there too easily...) or in danger of getting updated which might take a very long time easily).

Code works so that as long as there's rows which haven't got update yet but do have product run code(or something like that. Not quite sure what that number is but I figure it's product run) after code reached that far(which it copied from another file). Then for each row it calls functions for each cell which are responsible for filling invidual cells.

So either way to replace content of whole row with values or invidual cells, I can insert both into loop easily though whole row after cells are calculated would be a) faster to add(just one place to add, not 30...) and likely faster to run(project is about getting the file to run faster afterall...).

View 2 Replies
View Related
Apr 24, 2009

Converting formula to static code. I am currently using the following code on a spreadsheet:

View 3 Replies
View Related
Oct 6, 2008

I am having trouble converting the following Countifs formula developed in 2007 to work in 2003 Excel.

Basically, I want to count the frequency of "N" in 'Data_Q2 2008'!$S$2:$S$9806, where 'Data_Q2 2008'!$B$2:$B$9806 = 'Metric Upload'!C2.

'Data_Q2 2008'!$B$2:$B$9806 is a list of physicians. 'Metric Upload'!C2 is a pick list for selecting the physican that is in the larger data set using Data Validation.

View 14 Replies
View Related
Mar 14, 2014

I want a formula for converting a number to text

For example: 2550 ( two thousand five hundred fifty). I found one formula (BAHTTEXT) but it convert into Thai Language.

View 9 Replies
View Related
Jul 6, 2006

I'm having a slight problem as I cannot find a way to translate the following code from my worksheet formula to VBA: =IF(LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))=1,A1,MID(A1,1,FIND("-",A1,FIND("-",A1)+1)-1)). The code takes a value from one cell and takes the part that I need. There are two main types of inputs, they are in the form:

aaa-aaaaaaa-aaaaaa

aaaa-aaaaaa

The lengths are variable, but for the sake of showing you an example I have simplified it to the previous. The formula takes the part of the string that is before and after the first hyphen and puts it in the cell next to it.

View 6 Replies
View Related
Mar 13, 2013

Looking for a formula to convert time (00:00:00 AM) to a general 4 digit number (0000). Example 08:30:00 AM ---> 0830. Tried using format cells but no luck.

I was able to convert a standard number to time using the following formula: =TIME(INT(H2/100),MOD(H2,100),0)

View 2 Replies
View Related
Apr 13, 2009

I have a paper-based scoring sheet that we use to determine a rating category. I cannot figure out how to convert this scoring sheet into a lookup region and use some type of LOOKUP formula to determine the rating. I have looked at the various Grading examples on the Internet that show you how to look up a grade, based on a score, but they only look up a grade, based on a single input (the score).

Here I have two values going in--the person's age and their score, and I need to look up the rating, which is the column heading.

Can anyone point me in the right direction?

I've attached a sample spreadsheet which shows the original scoring sheet.

View 7 Replies
View Related
Oct 21, 2011

I am using a spreadsheet which imports information from an access database then calculates prices based on that.

At the moment in my column "0" I am referencing the number values in column CT from my access database (which gives me a standard retail price)

Code:

=IF(AF5="","",IF(OR('Line list'!CT2="",'Line list'!CT2=0,'Line list'!CP2=0),"0",'Line list'!CT2))

And then I use the following formula to work out the correct prices wholesale prices for different countries based on that.

Code:

=IF(AL5>1,AL5,IF(AK5

View 5 Replies
View Related
Jan 22, 2014

I have attendance tables that has column Y showing the shift to be worked and column Z showing any absentees. I used the following formula to count the number of people off per period.

{=SUM(COUNTIFS($Y$5:$Y$29,AM,$Z$5:$Z$29,$W82),(COUNTIFS($Y$36:$Y$60,AM,$Z$36:$Z$60,$W82)))}

in the above formula AM relates to a list of morning shifts.

The problem I have now encountered is that the system at work is still using excel 97 - 2003 which does not recognise Countifs.

way to adapt the formula to be compatible with Excel 97.

View 7 Replies
View Related
Mar 13, 2014

Formula (or a chart) for converting centimeters to inches.

View 1 Replies
View Related
Mar 31, 2009

--------------------------------------------------------------------------------

Ok i have a formula that i use to convert bond prices, which are in 32nds to numbers that excel can understand. I use the formula:

=LEFT(F7,FIND("-",F7)-1)+SUBSTITUTE(RIGHT(F7,LEN(F7)-FIND("-",F7)),"+","")/IF(RIGHT(RIGHT(F7,LEN(F7)-FIND("-",F7)),1)="+",64,32)

This allows me to type 101-16 in and excel recognizes this as 101.5

My problem is that my data I am copying into the sheet is often in 1/8ths. So the price will come in as 101-272, which means 101-27 and 2/8 (or 1/4).

I admittedly dont understand this formula and just use. Can someone help me tweak it to recognize the third digit?

View 11 Replies
View Related
Mar 20, 2014

A coworker is setting up an MS Project...project, and adding a custom field that would convert the Start date field into our Fiscal Quarter Fiscal Week schema, to display as FQFW, e.g. Q1W1. I've written the formula in excel, but I've never even touched Project until this week. Apparently it doesn't take formulas quite the same way as Excel does. I tried using the ''Switch" function in Project, and it worked, but it only accepts 14 arguments, and there are obviously 52 weeks we're dealing with. Would there be a way to do this using VBA? (I know next to nothing here as well.)

Formula where A1 is the Start Date:

Code:

=IF(AND(A1>=DATE(2014,2,1),A1=DATE(2014,5,3),A1=DATE(2014,8,2),A1=DATE(2014,11,1),A1

View 2 Replies
View Related
Jul 1, 2013

I have a formula in a cell which is refered to other cell within the same sheet and also to other sheet from other file. say

C1 = A1+B1+data file c1 Data file is another file in other location.

I was trying to break a external reference link (from Data File) from Data _ Edit Link, but it is converting all the formula to value. How is it possible to break only the external link without damaging the formula within the sheet say c1 = A1+B1+26 (value from data file c1)

View 5 Replies
View Related
Aug 13, 2013

I am migrating a bookkeepping spreadsheet from Quattro v12 (c2001) to Excel 2007 and have hit a stone wall over relative 3-D references.

In this workbook each sheet holds data for one month, and this includes some lagging-12-month calculations -- that is, summing a range on a single cell for the preceding 12 sheets (including this one).

Unexpectedly, this formula:

=ISUM('201206:201305'!M6)

gives absolute references, even though I put in no dollar signs after the sheet names. This means it gives the wrong answer when copied to the next sheet to start a new month.

I can find no reference at all to converting the above formula from absolute to relative reference.

View 5 Replies
View Related
Apr 7, 2009

Say I have 3 columns of data: A1:C10 and I want to run a Match() function on them all together to see if I get a match any one those cells, say the value of have in X1.

Since, Match only allows a One-Column lookup array.. is there a way to "concatenate" or "append" the 3 columns together within a formula so now I would be looking to Match in an array that is 1 column * 30 rows?

Basically want to convert =Match(X1,A1:C10,0) to =Match(X1,A1:A30,0) without moving around the raw data in the sheet.

And I want to avoid doing an AND or OR formula that uses 3 separate MATCH() for each column.

I have a hunch that the MMULT or MMULT/TRANSPOSE functions are involved, but can't seem to get it right.

View 6 Replies
View Related
Aug 22, 2006

creating a formula for converting time data that has been created in an excel spreadsheet in minutes i.e. 516 minutes which I need to turn into Hours and Minutes i.e. 08:36 I am not experienced using Formulas, apologies if this question has been posted before, I did use the search facility to look for threads, but could not find anything related

View 5 Replies
View Related
Jul 29, 2014

I have an excel table .xls : 1.jpg

And I have to convert it to .csv (as the only applicable format for a database mass upload) , but when I do this , all the 0 values (numbers) from the NEW ZIP POSTAL table disappear.

If I save it : 2.jpg

View 9 Replies
View Related
Jan 12, 2009

The issue is that there are six types of "numbers" in the table that I am trying to turn into all numbers. Obviously, I'd like to turn the Ks in 1,000s and the Ms into 1,000,000s:

#.##K

#.#K

#K

#.##M

#.#M

#M

If there weren't all six, I think I could fix this pretty easily, but as it is I'm pretty stumped (other than a manual fix).

View 4 Replies
View Related
Mar 24, 2009

I am currently exporting data into excel. The data i am exporting comes in the form of hh:mm:ss. When i export it into excel...everything appears fine. I am also using the data to generate charts. I have multiplied the values by 1440 in order to show as minutes for the charts.

When i import the data to excel and the hours value is bigger than 24, for some reason excel converts it into totally different figures. The minutes caluation (*1440) still works fine, but i need the actual hh:mm:ss to be correct, not amended by excel. Is there a way to do this. Ex. Data imported: 74:51:03 in hh:mm:ss - excel coverts this to 02:51:03.

View 2 Replies
View Related
Nov 29, 2011

I have put VBA code which will winzip all the excel files to .zip files in a folder. But problem is when i run the code it zips the file as .xls.zip.

For example:-

Sub Zipping()

'

Dim file As Variant

Const SOURCE = "E:Output"

[Code]....

So the output is :- abc.xls gets converted to abc.xls.zip

View 2 Replies
View Related
Aug 29, 2007

I have some code where it prompts you to enter a %, and then it calculates if the Lst Wk Sales > Avg Wkly Sales + %.

box2 = InputBox("Enter % increased by Sales")

ActiveCell.FormulaR1C1 = "=IF(RC[-111]>RC[-121]+" & box2 & ",""YES"",""NO"")"

The problem I have is that excel treats the formula as +50% rather +1.5. Can anyone help me around this issue?

View 9 Replies
View Related
Mar 29, 2009

I am working within Excel and am hoping to convert from A LOT of columns containing hh:mm:ss to AM at the end, however I am unsure of a fast / efficient way to do this. I am using MS Office Excel 07....

View 9 Replies
View Related
Sep 15, 2006

I was wondering if you can convert a program you have made on excel into an EXE. I then wanted to give trial period evaluation copies out, plus secure the program to a specific PC.

View 6 Replies
View Related
Nov 26, 2013

I know this is a dumb question but I can't get a sumif to work in vba. I want the actual formula in the cell, not just the output value.

This is my most recent attempt:

VB: Range("C2").Formula = "=SUMIF(Z7:Z12000, >0,N7:N12000)"

I get Run-time error 1004, application defined or object defined error.

Why doesn't this work?

View 2 Replies
View Related