+ Reply to Thread
Results 1 to 3 of 3

Sumif 1 of 2 criteria is met

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    2

    Sumif 1 of 2 criteria is met

    Hi,

    I'm having troubles turning this Excel formula:

    Please Login or Register  to view this content.
    into this VBA code:

    Please Login or Register  to view this content.
    The problem lies with the {} braces; vba doesn't recognize them. The formula needs to sum a range if the adjacent left cells equal 110.50 or 110.60.

    I could use sumproduct:
    Please Login or Register  to view this content.
    but once again the {} are used. Any ideas on how I can get around using {} within VBA? I'm not sure if evaluate will work since the range will be changed thousands of times using a variable within .Cells(variable, 2).

    Thank you!
    Last edited by bluetacos; 01-06-2014 at 12:47 AM.

  2. #2
    Forum Contributor
    Join Date
    03-28-2013
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    226

    Re: Sumif 1 of 2 criteria is met

    try this

    Please Login or Register  to view this content.
    Give Feedback and Click(*)

  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Sumif 1 of 2 criteria is met

    I need to be able to change the SUMIF range using a variable, hence why I was trying to use

    Please Login or Register  to view this content.
    With your formula is there a way I can change "B3:B25" with a variable? I have a loop that will go through thousands of cell combinations. I thought about using DSUM, but many of the loop iterations will only use a portion of the input cells (in the middle of the range) leaving me unable to select any type of headers. Please correct me in any sense I'm wrong.

    Thanks
    Last edited by bluetacos; 01-06-2014 at 02:18 AM.

+ 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. SUMIF or SUMIF's formula with multiple criteria
    By jackiemariee in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-30-2013, 06:19 PM
  2. SumIf using date criteria range and one other criteria
    By DJTMONEY in forum Excel General
    Replies: 1
    Last Post: 04-20-2010, 04:10 PM
  3. SUMIF with multiple criteria, one criteria a specific string
    By Weasel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-03-2008, 05:32 PM
  4. SumIf using 2 criteria??
    By jmr71483 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2007, 11:48 AM
  5. nested sumif or sumif with two criteria
    By dshigley in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-04-2005, 11:06 PM

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