+ Reply to Thread
Results 1 to 5 of 5

How to multiply two columns and get result in third range for a function

  1. #1
    Registered User
    Join Date
    09-02-2022
    Location
    Iceland
    MS-Off Ver
    MS 365 Enterprise
    Posts
    10

    Question How to multiply two columns and get result in third range for a function

    Hi everyone,
    I've searched far and wide but I'm not really getting what I'm doing wrong. This is a really simple procedure that I need to understand to make more complicated functions. I am not making a sub or using a designated column on a worksheet, this needs to be a function so it has to be range/variable based. I'm not an expert on VBA so I apologize for any mishandlings of correct terms, I'll try my best.

    What I want:
    Input:
    Column A: [3,4,8]
    Column B: [7,3,11]
    Output:
    Column C: [21,12,88]

    This is what I've been trying to use, and modifying to no avail:

    Please Login or Register  to view this content.
    I need to have the result display in a range like the index function does and the range itself needs to be able to be variable (not limited to a place on the worksheet, like the range that is chosen for the function can be 1-2 variables or 150 +. Of course for this to work the ranges A and B need to be equally long.

    This would really further my understanding if I could work with ranges like this, thank you very much for reading
    Last edited by HappyExcelLife; 09-02-2022 at 10:35 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,265

    Re: How to multiply two columns and get result in third range for a function

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here, I have done it for you this time.)
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-02-2022
    Location
    Iceland
    MS-Off Ver
    MS 365 Enterprise
    Posts
    10

    Re: How to multiply two columns and get result in third range for a function

    Thank you Ali

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,462

    Re: How to multiply two columns and get result in third range for a function

    With all of the same caveats I include in this discussion about when array output is necessary and when we should perhaps avoid array output, it seems you are trying to do the exact same thing this user was doing, except you are multiplying where he/she was adding: https://www.excelforum.com/excel-pro...o-columns.html Review that thread and you should be able to come up with something that works.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    09-02-2022
    Location
    Iceland
    MS-Off Ver
    MS 365 Enterprise
    Posts
    10

    Re: How to multiply two columns and get result in third range for a function

    Thank you so much! I have been stuck on this for hours. I needed to understand this to be able to make a function for calculating expected return of a portfolio. This is the final result and it works

    Please Login or Register  to view this content.

+ 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] Trying to Multiply the result of an IF function combined with a VLOOKUP function
    By ucca in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-28-2018, 02:32 AM
  2. Replies: 4
    Last Post: 01-10-2014, 09:32 AM
  3. Replies: 4
    Last Post: 09-04-2013, 09:58 AM
  4. [SOLVED] VBA Multiply Function & Sub Procedure to Show Result
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-24-2013, 06:05 AM
  5. Replies: 4
    Last Post: 06-25-2012, 10:38 AM
  6. Multiply result of IF function in same cell
    By rockytop80 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-10-2012, 12:23 PM
  7. How to multiply 2 columns with variable range?
    By Wino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2009, 09:55 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