+ Reply to Thread
Results 1 to 16 of 16

Array multiplication

  1. #1
    Registered User
    Join Date
    06-22-2015
    Location
    India
    MS-Off Ver
    Office 365 / 2021
    Posts
    62

    Array multiplication

    Hi everyone,

    I have two sheets.I have a fixed column F5:F8.I want to multiply this with Sheet1,E4:H7 but heading should be match.

    I have done manually in Sheet2 at B5:E8.

    This I want in a single formula in Sheet2.

    Plz note heading position might be same or different.
    Attached Files Attached Files

  2. #2
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,544

    Re: Array multiplication

    Do you have 365 or 2021? It matters, as there are significant differences.

    I would use FILTER to isolate the correct column from the matrix and then multiply.

    =FILTER(matrix,header=x)*your_range

    I’m on my iPhone so can’t give an exact formula at the moment.
    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.

  3. #3
    Registered User
    Join Date
    06-22-2015
    Location
    India
    MS-Off Ver
    Office 365 / 2021
    Posts
    62

    Re: Array multiplication

    I do have both.Plz do from both if possible.

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,544

    Re: Array multiplication

    Please change your profile to the OLDEST version you need solutions to work for ONLY.

    The suggestion in post #2 should work in either.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: Array multiplication

    For O365, delete ALL expected results:

    =LET(A,F5:F8,B,B3:E3,C,Sheet1!E4:H7,D,Sheet1!E2:H2,A*DROP(REDUCE("",B,LAMBDA(y,z,HSTACK(y,FILTER(C,D=z)))),,1))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: Array multiplication

    for both:

    =$F$5:$F$8*FILTER(Sheet1!$E$4:$H$7,Sheet1!$E$2:$H$2=B3)

    copied across.
    Attached Files Attached Files

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Array multiplication

    Please try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-22-2015
    Location
    India
    MS-Off Ver
    Office 365 / 2021
    Posts
    62

    Re: Array multiplication

    Thanx Ali,Glenn & Hans.All worked.

    Can you kindly explain me if the source data is not in proper order or not arranged properly then whether it would give me the correct result by above formula.

    What I have seen that A5:A8 of Sheet2 was not found in the formula with that of matching of Sheet1 of D4:D7 & vice versa.
    Last edited by Ekac; 12-23-2023 at 05:43 AM.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: Array multiplication

    Can you kindly explain me if the source data is not in proper order or not arranged properly then whether it would give me the correct result by above formula.
    What happened when you tried them in a different order?

    What I have seen that A5:A8 of Sheet2 was not found in the formula with that of matching of Sheet1 of D4:D7 & vice versa.
    Please post a file showing what you mean.

  10. #10
    Registered User
    Join Date
    06-22-2015
    Location
    India
    MS-Off Ver
    Office 365 / 2021
    Posts
    62

    Re: Array multiplication

    Pls see that I have changed the order both row & column header in Sheet2 with that of red font.

    What would be the result ? same or different ?

    I think I have tested it gives me incorrect result.Above formula is applicable if both row & column header are same.If both are different then it won't works.
    Attached Files Attached Files
    Last edited by Ekac; 12-23-2023 at 06:02 AM.

  11. #11
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,544

    Re: Array multiplication

    In B5 copied across and down:

    =LET(f,FILTER(Sheet1!$E$4:$H$7,Sheet1!$E$2:$H$2=B$3),FILTER(f,Sheet1!$D$4:$D$7=$A5))*$F5

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,508

    Re: Array multiplication

    Old-fashioned

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    !
    Last edited by JohnTopley; 12-23-2023 at 06:21 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  13. #13
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Array multiplication

    Or try in B5 and copy to the right and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: Array multiplication

    1. Delete all expected results.

    2. For 2021, in B5, copied ACROSS:

    =$F$5:$F$8*INDEX(FILTER(Sheet1!$E$4:$H$7,Sheet1!$E$2:$H$2=B3),MATCH($A$5:$A$8,Sheet1!$D$4:$D$7,0))

    3. Or for O365, in B5, no copy paste at all:

    =DROP(REDUCE("",B3:E3,LAMBDA(y,z,HSTACK(y,F5:F8*INDEX(FILTER(Sheet1!E4:H7,Sheet1!E2:H2=z),MATCH(A5:A8,Sheet1!D4:D7,0))))),,1)
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    06-22-2015
    Location
    India
    MS-Off Ver
    Office 365 / 2021
    Posts
    62

    Re: Array multiplication

    Thanx all of u Ali,Hans,John & Glenn for your contributions.Now it seems to be perfect.

  16. #16
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Array multiplication

    Thanks for the feedback. Glad to have helped. .

    If you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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] VBA: Multiple output function & Matrix/array multiplication
    By av1993 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2020, 05:22 PM
  2. Replies: 2
    Last Post: 03-27-2019, 02:09 PM
  3. Array Sum/Multiplication excluding rows containing external value
    By Douglasfix in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-31-2018, 03:19 PM
  4. Subset a range for array multiplication
    By mpm166 in forum Excel General
    Replies: 5
    Last Post: 04-16-2012, 06:57 PM
  5. Transforming array multiplication from Excel to VBA function
    By gren in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-22-2012, 09:56 AM
  6. Replies: 11
    Last Post: 02-18-2009, 10:49 AM
  7. working with array multiplication
    By analyst1012 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2008, 02:48 AM

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