+ Reply to Thread
Results 1 to 14 of 14

sum_if_macro

  1. #1
    Registered User
    Join Date
    01-05-2020
    Location
    israel
    MS-Off Ver
    excel 2016
    Posts
    21

    sum_if_macro

    Hello
    I need a solution where there are empty cells next to digit 1 enter a sum of the prices that are next to digit 2,
    the problem is that I have a lot of lines and my array is changing I will probably need a macro.
    Attached Files Attached Files

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: sum_if_macro

    Try this formula in J4:

    Please Login or Register  to view this content.
    Enter with Ctrl+Shift+Enter to create an array formula. You can then copy the formula to J13 and further down as required.

    Does that work?

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: sum_if_macro

    You could add a helper column, then use a SUMIF.

    In K4:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In L4:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Copy both down.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Registered User
    Join Date
    01-05-2020
    Location
    israel
    MS-Off Ver
    excel 2016
    Posts
    21

    Re: sum_if_macro

    no, this no work

  5. #5
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: sum_if_macro

    Quote Originally Posted by omri_k View Post
    no, this no work
    Not sure who that is directed at. See attached for implementation of my formula.

    WBD
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-05-2020
    Location
    israel
    MS-Off Ver
    excel 2016
    Posts
    21

    Re: sum_if_macro

    this not working

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,222

    Re: sum_if_macro

    problem is that I have a lot of lines and my array is changing
    so...why not upload a ,sample file with lot a lines...and someone might be kind enough to incorporate the formula into vba....
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  8. #8
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: sum_if_macro

    Quote Originally Posted by omri_k View Post
    this not working
    As above, tricky to help with limited feedback. The formula in the attachment I provided clearly *is* working. I'm not clear on what you need.

    WBD

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,222

    Re: sum_if_macro

    Here is an easy to understand loop macro...
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    01-05-2020
    Location
    israel
    MS-Off Ver
    excel 2016
    Posts
    21

    Re: sum_if_macro

    sorry this working
    tnx man

  11. #11
    Registered User
    Join Date
    01-05-2020
    Location
    israel
    MS-Off Ver
    excel 2016
    Posts
    21

    Re: sum_if_macro

    I like this

  12. #12
    Registered User
    Join Date
    01-05-2020
    Location
    israel
    MS-Off Ver
    excel 2016
    Posts
    21

    Re: sum_if_macro

    Quote Originally Posted by sintek View Post
    here is an easy to understand loop macro...
    Please Login or Register  to view this content.
    wow i must learn vba this is amazing

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,222

    Re: sum_if_macro

    If this solves your initial requirement, then please mark thread as solved...

  14. #14
    Registered User
    Join Date
    01-05-2020
    Location
    israel
    MS-Off Ver
    excel 2016
    Posts
    21

    Re: sum_if_macro

    Quote Originally Posted by sintek View Post
    If this solves your initial requirement, then please mark thread as solved...
    I'm new to this site How do you do it?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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