+ Reply to Thread
Results 1 to 4 of 4

Adding criteria to formula

  1. #1
    Registered User
    Join Date
    11-02-2017
    Location
    Bucharest
    MS-Off Ver
    2016
    Posts
    51

    Adding criteria to formula

    Hi!

    I have this formula : It sums the last 6 numbers from the A:A range

    =SUM(INDEX(A:A,COUNTA(A:A)-5):INDEX(A:A,COUNTA(A:A)))

    How can i add a criteria ? For example i have names in column 2 (B:B) and name 'BOB' is finding as 20x times in this column...
    How i can modify this formula to sum the last 6 numers from A:A range having criteria 'BOB' (also 'BOB' if he is 20 times in B:B range i need to get the last 6 'BOBS' if you know what i mean :D)

    Thank you !

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Adding criteria to formula

    Hi

    an attempt


    =SUM(INDEX(B1:B1000,AGGREGATE(14,6,ROW(1:1000)/(A1:A1000="BOB"),INDEX(ROW(1:6),))))

    Please, refer to the attachment.

    Regards
    Attached Files Attached Files
    Last edited by canapone; 05-03-2019 at 09:00 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    11-02-2017
    Location
    Bucharest
    MS-Off Ver
    2016
    Posts
    51

    Re: Adding criteria to formula

    Not working

    EDIT : Sorry for making any confusion, is working.
    Thank you!
    Last edited by Spikyd; 05-03-2019 at 09:04 AM.

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Adding criteria to formula

    Ciao,

    thanks for sharing kind feedback.

    If you'd need to sum first 6 Bob's numbers, set first argument of AGGREGATE as 15

    Last numbers

    =SUM(INDEX(B1:B1000,AGGREGATE(14,6,ROW(1:1000)/(A1:A1000="BOB"),INDEX(ROW(1:6),))))

    First numbers

    =SUM(INDEX(B1:B1000,AGGREGATE(15,6,ROW(1:1000)/(A1:A1000="BOB"),INDEX(ROW(1:6),))))

    regards

+ 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. Replies: 4
    Last Post: 08-06-2018, 07:54 AM
  2. Adding 1 criteria into existing formula
    By vill in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-02-2018, 02:52 PM
  3. Help adding criteria to INDEX formula
    By marciofo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-09-2016, 04:44 AM
  4. [SOLVED] Formula for adding different criteria
    By hmwelch in forum Excel General
    Replies: 6
    Last Post: 03-23-2016, 06:46 PM
  5. [SOLVED] Adding another criteria to a formula
    By Xeba37 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-22-2016, 05:29 AM
  6. Adding criteria to an array formula
    By jonagpa in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 01-09-2016, 11:28 PM
  7. Adding Criteria to IFSUMS Formula
    By quibilty in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-27-2013, 12:22 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