Questions tagged [excel-udf]

User-defined functions (UDFs) are VBA procedures that typically take inputs (although inputs are not mandatory) to return a result to either a worksheet cell, or to another VBA procedure. By design UDF's that are called from a worksheet should only return a value to the cell from where the function was called - the UDF should not modify the contents or formatting of any cell, or the operating environment of Excel (there are workarounds to this design).

90 questions
1
vote
2 answers

How to use goal seek function in Excel user function?

There is method to use goal seek in MS excel like follows code. It works fine. Sub GSeek() With Worksheets("Sheet1") .Range("H18").GoalSeek _ Goal:=.Range("H21").Value, _ …
Yun_cn
  • 31
  • 1
  • 3
1
vote
4 answers

UDF with infinite parameters

I am writing a User Defined Function (UDF) which take some cells as argument. These cells contain the same data but with a different level of precision; the function show the best precision available. The argument of the funcion are written in the…
Nicolaesse
  • 1,791
  • 7
  • 38
  • 58
1
vote
3 answers

Find how many words from cell are found in an array

I have two columns with data. The first one has some terms and the other one contains single words. what I have I'm looking for a way to identify which words from each cell from the first column appear in the second, so the result should look…
Paula
  • 15
  • 4
1
vote
1 answer

Create UDF that works when dragged down

I think I'm overlooking something simple... My idea is to create a function in Excel that's easier to set up than the following: =INDEX($A$1:$A$5,AGGREGATE(15,6,ROW($B$1:$B$5)/($B$1:$B$5=1),ROW(1:1))) (see ScottCraner's comment in this answer for…
BruceWayne
  • 21,782
  • 14
  • 49
  • 95
1
vote
4 answers

Excel UDF for capturing numbers within characters

I have a variable text field sitting in cell A1 which contains the following: Text;#Number;#Text;#Number This format can keep repeating, but the pattern is always Text;#Number. The numbers can vary from 1 digit to n digits (limit…
Ray
  • 93
  • 1
  • 7
1
vote
1 answer

Function is called without being called and stops the main macro

I have this Sub which does 2 basic calculations in a loop and then I have a UDF (see below). My issue: When I run the Sub BSM_Table it calls the function at this line: If Cells(i, 2) > 0 And Cells(i, 3) > 0 Then and the sub stop. I guess it is…
manu
  • 912
  • 8
  • 16
1
vote
1 answer

Disable excel UDF calculation in "insert function" prompt

Is there any way to disable an excel UDF function (I´m currently using excel DNA library) when it is called by "insert function" prompt? My Excel UFD function makes webservice calls and this behavior on "insert function" prompt is overloading the…
Raphael do Vale
  • 841
  • 2
  • 11
  • 26
1
vote
3 answers

Extract 5-digit number from one column to another

I need help with extracting 5-digit numbers only from one column to another in Excel 2010. These numbers can be in any position of the string (beginning of the string, anywhere in the middle, or at the end). They can be within brackets or quotes…
Annette O.
  • 13
  • 5
1
vote
1 answer

UDF using FindNext seems to abort without warning

I have the following user-defined function, which attempts to find the nth non-empty cell in a range: Option Explicit Function finn_prioritert_oppgave(nummer As Long) As String Dim i As Long, r As Range, c As Range Set r =…
eirikdaude
  • 2,956
  • 5
  • 20
  • 45
1
vote
1 answer

Returning #value when for string after an Excel calculation

This user defined function calculates some value; according to that I need to return a string in the calling cell. The MsgBox test in the function works, but in the cell I am getting only a #value! error. Why? Function WoodClassify(Length As…
Sujith Wayanad
  • 552
  • 5
  • 20
1
vote
1 answer

HIVE: Execution Error, return code [-101] (unknow error) from org.apache.hadoop.hive.ql.exec.FunctionTask

I write a UDF as flow: package com.test; import org.apache.hadoop.hive.ql.exec.UDF; import org.apache.hadoop.io.Text; public class Lower extends UDF { public Text evaluate(final Text s) { if (s == null) { …
Sparks_Fly
  • 359
  • 3
  • 14
1
vote
1 answer

How to pass non-contiguous cells to Excel UDF

in myUDF, I can reference a range of cells like "A1:A12", but how can I reference non-contiguous cells like "A1,B4,H3" etc. I use ExcelDNA, the parameter type is object but it seems it will take string, and a range of cells, not non-contiguous…
toosensitive
  • 2,129
  • 6
  • 40
  • 80
0
votes
1 answer

Excel Automation Addin function returing excel range

I am writing a Excel 2003 automation addin using c#. I have followed this article http://blogs.msdn.com/b/eric_carter/archive/2004/12/01/writing-user-defined-functions-for-excel-in-net.aspx Every thing works including passing excel range object as…
RajeevNy
  • 28
  • 6
0
votes
0 answers

What Excel VBA or UDF options exist to look up values in a closed workbook

I currently use a UDF to look up values from a table in my personal workbook and it works just as I need it to. However I was hoping to be able to share this UDF with other people I work with. I have mine saved in a .xlam and loaded as an addin. I…
Derek
  • 145
  • 8
0
votes
3 answers

custom function in excel using vba that works in any matchine

I have created a custom function via vba in excel. If I use it in my computer, it works ok, but if I change the file to another computer (where this computer also has the created function), it does not work. I must change the path of the created…
Mouse
  • 1