+ Reply to Thread
Results 1 to 7 of 7

Create custom function to multiply numeric values!?

  1. #1
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    67

    Create custom function to multiply numeric values!?

    I have some files in which there is a column where there are string data like

    column C
    abc10po2x33
    m20xpx12zo1
    qw45x39x12
    ...etc

    I'm trying to get the product of the 2nd and 3rd numeric values using a custom function.
    I've tried
    Please Login or Register  to view this content.
    Wished results are(in bold):

    66 i.e.(2*33)
    12 i.e.(12*1)
    468 i.e.(39*12)
    ...etc

    But the code is not working, please help.

    Also, how do I use this function in any of my excel file and not a particular file?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Create custom function to multiply numeric values!?

    I was able to achieve this using Power Query/Get and Transform which is available to you as it was added as an add in to 2010. Here is the Mcode and the file

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    67

    Re: Create custom function to multiply numeric values!?

    Hi Alan, can you tell me how to do this in excel 2007?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Create custom function to multiply numeric values!?

    Your forum profile says 2010, which supports PowerQuery - 2007 does not. You should have mentioned this or changed your forum profile before posting. YOu will need to wait for someone to offer an alternative solution.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Create custom function to multiply numeric values!?

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  6. #6
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    67

    Re: Create custom function to multiply numeric values!?

    Thanks AlphaFrog

    BTW, how can I make this function available for any excel file that I work with ?

    Also, do you mind explaining your code a bit ?

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Create custom function to multiply numeric values!?

    BTW, how can I make this function available for any excel file that I work with ?
    Save it in your Personal.xlsb file. If you don't have one, then .....

    https://www.rondebruin.nl/win/personal.htm

+ 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. [SOLVED] Extract numeric value from string, and multiply by parts Qty
    By Anxiety in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-01-2015, 11:09 AM
  2. OR Function for Non-Numeric Values
    By paperbucket in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-30-2015, 03:52 PM
  3. [SOLVED] vba macros to force user to input numeric values for numeric values with hyphen
    By Abdur_rahman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2013, 01:05 PM
  4. [SOLVED] Help to Create a Macro that will sort by name and count non-numeric values
    By acamm9 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-21-2012, 01:22 PM
  5. Multiply text values with numeric substitutions
    By jheddings in forum Excel General
    Replies: 2
    Last Post: 07-11-2009, 07:08 PM
  6. Create custom function
    By andyiain in forum Excel General
    Replies: 3
    Last Post: 03-31-2006, 11:33 AM
  7. Create Custom Sum Function
    By L2B in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-09-2005, 09:29 AM

Tags for this Thread

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