+ Reply to Thread
Results 1 to 4 of 4

Help to create a user defined function with IF and AND

  1. #1
    Registered User
    Join Date
    07-02-2014
    Location
    Florida, USA
    MS-Off Ver
    Office 2013
    Posts
    28

    Help to create a user defined function with IF and AND

    Hello My Name is Eliana

    I am trying to create a function using the functions of IF and "And", but for any reason I don't know how to add the Add function

    My function written in excel will looks like =IF(AND(A80="00",C80<>"8300"),"yes","no")

    LOB Cost Center
    00 1000
    00 2000
    00 8300
    01 5000
    02 8300

    Function Allocation(LOB As Integer, CostCenter as Integer) As String
    If LOB = 00 And CostCenter <> 8300 Then
    Allocation = "Yes"
    ElseIf LOB = 1, 2, 3, 4, 5 Then
    Allocation = "No"

    End If

    End Function

    I am doing something wrong, I appreciate any help or feedback provided.

    Thanks so much for your help.

    Eliana

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Help to create a user defined function with IF and AND

    You could try

    Please Login or Register  to view this content.
    Martin

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Help to create a user defined function with IF and AND

    Your custom function does not have any range references

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-02-2014
    Location
    Florida, USA
    MS-Off Ver
    Office 2013
    Posts
    28

    Re: Help to create a user defined function with IF and AND

    Hello Martin, thank you so much for your help. It helped me a lot. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Create a User Defined Function in VBA using the IF and "and" as Function
    By Elomaldo in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 07-16-2014, 12:35 PM
  2. Use formula to create a User Defined Function
    By lindomsm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2013, 06:54 AM
  3. How do I create a user-defined function in Excel 2011?
    By dpbsmith in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2012, 06:26 PM
  4. VBA/Excel - how do I create a user-defined function out of a makro?
    By marasmussen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2007, 08:21 PM
  5. How can I create a user defined function in excel?
    By Martinj in forum Excel General
    Replies: 4
    Last Post: 08-20-2005, 02:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1