Results 1 to 3 of 3

Thread: Array formulas

  1. #1
    New Lounger
    Join Date
    Feb 2001
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Array formulas

    I am working on revamping my organization's expense report. I've been trying to figure a total based on two conditions. Here's an example of what I'm trying to accomplish: if a cell in the range of B6:B30=A and a cell in the range of F6:F30=520 then I want to add their totals, but only if they're in the same row. For instance if B8 has an A and F8 has 520, then I want whatever is in the row 8 total column added to all the other "A520"s. I searched Microsoft's website, figured out I needed to use an array formula, and found some samples. It seemed like the SUMIF function was what I should use. I tried these formulas and neither worked: {=SUM(IF((B6:B30="A")*(F6:F30="520"),G6:G30))}and {=SUM(IF((B6:B30="A")+(F6:F30="520"),G6:G30))}. Then I posted this question on a local helpnet, and someone suggested I try this: {=SUM(IF(B6:B30="A",IF(F6:F30="520",G6:G30)))}. That didn't work either. Does anyone have any suggestions as to what may be going wrong here? Any help would be greatly appreciated!

    Thank you,
    Amy

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Array formulas

    Hi Amy,
    My first thought would be to check if your 520s are text or numbers. I think most of those formulas might work if you changed the ="520" bit to =520 (Excel won't equate the number five hundred and twenty with "520" if you see what I mean - one is text, the other is a number.)
    Hope that helps.
    PS I've assumed you aren't typing the curly braces in manually but rather are array-entering it - i.e. typing =SUM(IF(B6:B30="A",IF(F6:F30=520,G6:G30))) then pressing Control-Shift and Enter?
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    St. George, Maine, USA
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Array formulas

    Rory is correct. Does the attached meet your requirements?

    Bob_D
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •