+ Reply to Thread
Results 1 to 6 of 6

SUMIF Formula with criteria in variable reference worksheet

  1. #1
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    SUMIF Formula with criteria in variable reference worksheet

    I have the below macro that cycles through the worksheets in my workbook and adds certain values.

    I have a SUMIF formula highlighted in red below.

    I cannot get the criteria to work. If I hard code "Week 0" as below, this works. But I need to reference the cell which is in fact that previous cell in the sheet.

    I tried

    Please Login or Register  to view this content.
    but this returned a #NAME? error.

    I know I am close but I just cannot figure it out?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: SUMIF Formula with criteria in variable reference worksheet

    Please provide a sample data workbook (false data for reasons of confidentiality and privacy)

  3. #3
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: SUMIF Formula with criteria in variable reference worksheet

    Try
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: SUMIF Formula with criteria in variable reference worksheet

    Quote Originally Posted by ByteMarks View Post
    Try
    Please Login or Register  to view this content.
    that works just great! Thank you!

  5. #5
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: SUMIF Formula with criteria in variable reference worksheet

    How can I now autofill down for each of these? I have attached a sample workbook to illustrate what I am trying to do.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: SUMIF Formula with criteria in variable reference worksheet

    Maybe if you made the formula references absolute and got the column and the last row, you could populate the formula in one go.

    Please Login or Register  to view this content.

+ 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. Formula using reference to variable worksheet
    By Storgaard292 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2020, 04:09 AM
  2. [SOLVED] Variable for Criteria in SUMIF Formula
    By pkew22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-16-2017, 03:27 PM
  3. [SOLVED] variable criteria in sumif formula
    By davemon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-09-2015, 10:21 PM
  4. How do I add a variable row number into a SumIf formula cell reference
    By Whit01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2013, 06:19 AM
  5. how do i reference a worksheet variable in a formula?
    By chemeng1T3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2012, 08:27 AM
  6. Replies: 2
    Last Post: 10-06-2009, 04:32 AM
  7. [SOLVED] Reference Worksheet Name variable in VBA formula
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2006, 03:05 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