+ Reply to Thread
Results 1 to 11 of 11

Complex Array Formula

  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    3

    Complex Array Formula

    I have been searching for a formula that can add two different types of data in the same range and haven't found anything. Please help.

    Given data:

    Mon Tues Wed Thur Fri
    AL 6 SL 2
    SL 2 AL 6 AL 8 AL 8

    The result for these two weeks are AL = 28 and SL = 4.

    What formula will work to arrive at these desired results?

    thanks,
    Sam
    Last edited by Ignatius107; 04-22-2013 at 09:46 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Adding two types of data in the same range

    Hi

    Can you please add an example workbook as I can't determine the structure based on the formatting in the post.

    rylo

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080

    Re: Adding two types of data in the same range

    Your example data isnt clear, its impossible to work out whats in Mondays column, is it just AL or is it AL AND 6?
    Use a comma as a separator so the data is legible.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Adding two types of data in the same range

    Hello,

    First, I suggest you change the name of this thread so others will have an easier time looking for solutions for their problems similar to yours, or try to help you.
    Second, you can try this Array formula
    Please Login or Register  to view this content.
    To find the sum of all that has AL before it.
    Here is a sample file (Next time please provide one before hand).
    Attached Files Attached Files
    Last edited by Lemice; 04-22-2013 at 06:49 PM.
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  5. #5
    Registered User
    Join Date
    04-22-2013
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Adding two types of data in the same range

    thanks Lemice.

    I am having trouble manipulating your formula to fit into my spreadsheet. I have attached a copy, if you could please take a look at it.

    Also, what suggestions do you have for editing the title: Complex Array Formula?

    Sam
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Adding two types of data in the same range

    Because it is an Array formula, you need to hold Ctrl-Shift then hit Enter (You can see the formula warped inside a { })
    You can check the attached file.
    Attached Files Attached Files
    Last edited by Lemice; 04-22-2013 at 09:52 PM.

  7. #7
    Registered User
    Join Date
    04-22-2013
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Adding two types of data in the same range

    Ah... thanks.

  8. #8
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Adding two types of data in the same range

    I also fixed something in the formula, so now it will calculate by row. Check the attached file, I just changed it

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding two types of data in the same range

    Try these array formulas**:

    For the sum of AL:

    =SUM(IF(LEFT(C3:L3,2)="AL",--MID(C3:L3,4,3)))

    For the sum of SL:

    =SUM(IF(LEFT(C3:L3,2)="SL",--MID(C3:L3,4,3)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  10. #10
    Registered User
    Join Date
    04-12-2013
    Location
    davao city philippines
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Complex Array Formula

    HELLO...i find MIKE7952'S code for "Search Data.xlsm" at http://www.excelforum.com/excel-prog...-database.html very helpful to make my inventory work very easy... but my product details has "12 columns", can you help me make it, that i can search on "data" sheet from either "A" or "B" and all the details from Colomn A to L appears on the "search" sheet / list. pls help....thank you so much.

    Please Login or Register  to view this content.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Complex Array Formula

    You should start your own thread.

+ 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