Suming and Subtracting

O_Junior

New Member
Joined
Oct 22, 2014
Messages
31
Hey guys,

I need some help. I need a formula that, sum from I7:I1000 if the cells A7:A1000 are filled with "RL1", and G7:G1000 are filled with TODAY() date, but i need to subtract the value of I7:I1000 if the cells J7:J1000 are filled with "OK". I don't know how to do that and I've been trying to come up with a solution for weeks now! Can someone help me?
 
Works just fine for me..

If you're getting 0 it means none of the rows met ALL the criteria of the formula.
Try individual formulas with one criteria each to narrow down the issue.

which of these is not giving the correct result?

=SUMIFS(I7:I1000,A7:A1000,"RL1")
=SUMIFS(I7:I1000,G7:G1000,TODAY())
=SUMIFS(I7:I1000,J7:J1000,"<>OK")


Here it is working on my sheet

Excel Workbook
AGIJKL
7RL111/26/20142othertext8
8RL111/26/20144OK
9RL111/26/20146moretext
10RL111/26/20148OK
Sheet1
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
The TODAY function is not working, maybe because it appears in the cell as DD/MM/YYYY HH:MM? Or because of the VBA that make it appears?
 
Upvote 0
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub

If Not Intersect(Target, Range("B7:B10000")) Is Nothing Then
If Target <> "" Then
Target.Offset(0, 5) = Now()
Else
Target.Offset(0, 5) = ""
End If
End If

End Sub
 
Upvote 0
Target.Offset(0, 5) = Now()

That's the problem, Now returns the Date+Time, not just the date.
But the TODAY() function is just Date, no time.
So indeed, NONE of the dates in column G = TODAY()
(unless the code just happened to run at exactly Midnight...very unlikely)

Try changing Now to Date

This won't correct the dates that already exist in the cells, they'll have to be manually changed to remove the time value.
 
Upvote 0
or perhaps

=SUMIFS(I7:I1000,A7:A1000,"RL1",G7:G1000,">="&TODAY(),G7:G1000,"<"&TODAY()+1,J7:J1000,"<>OK")
 
Upvote 0
That's the problem, Now returns the Date+Time, not just the date.
But the TODAY() function is just Date, no time.
So indeed, NONE of the dates in column G = TODAY()
(unless the code just happened to run at exactly Midnight...very unlikely)

Try changing Now to Date

This won't correct the dates that already exist in the cells, they'll have to be manually changed to remove the time value.

You mean changing NOW to DATE in the VBA? Or the spreadsheet itself?
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top