Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9227143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:59:48+00:00 2026-06-18T04:59:48+00:00

I am trying to sum a row biased on the fact that another row

  • 0

I am trying to sum a row biased on the fact that another row has the same month as a variable that is defined by the user. I believe the sumif function would be my best bet but it doesn’t seem to be working for me. The row I want it to look at obviously is a row of Date with date formatting (used .numberformat = “ddd mm/dd”) but the sumif doesn’t seem to be able to pick out the month in each cell. Here is the code I have so far:

Dim cMade As Integer
Dim sDate As Date
 cMade = cMade + Application.WorksheetFunction.SumIf(ActiveSheet.Range("B1:RC1"), Month(sDate), ActiveSheet.Range("B30:RC30"))

As you can see sDate is the date that the user imputs via userform then i convert that using dateserial. and B1-RC1 are the dates i want it to look at. And Range B30-RC30 are the sums i want it to grab if the months match up (the reason I have it as + cMade is because it is in a loop that loops through sheets).

Is this code correct? I have been messing with it and looking for alternatives for hours but I cant not seem to come up with anything!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:59:49+00:00Added an answer on June 18, 2026 at 4:59 am

    Assuming this is only a part of your code and I may only guess the rest, try the following corrections:

    1. I think you should define Range("B30,RC30") as Range("B30:RC30") – comma here looks like a typo according to the description.
    2. Replace Application.SumIf with Application.WorksheetFunction.SumIf.

    As an addition, consider to define ranges more precise, e.g. via Worksheets("Sheet1").Range("A1:C10") or ActiveSheet.Range("A1:C10") syntax. However, this may be an extra measure – I don’t see the rest of your code.

    Hope that was somehow helpful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display a row, 'Total', that will do a sum of the
Think my problem is I am trying to sum a count in the same
Trying to figure out how to write a jquery formula that will sum all
I am trying to create a query that allows me to get the sum
I'm trying to use LINQ to SQL to sum a row in a a
I am trying to write a query that calculates SUMS of a row and
I am trying to create a dynamic range using Excel functions that will sum
I'm trying to create a page that displays statistics for every player. A sum
Im trying to get the sum of workouts in a row and then order
I'm trying to do a SUM and store it in another table. The SUM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.