Alex Barnes4 said:Yeah, sure, that’s easy enough, but my actual question was how to calculate that sum without having to stretch out column "c"—basically, I just want the total to show up in one single cell and nothing else.
Look, I went ahead and whipped up a little Macro for you, just because it’s easier for me to explain it this way. 🙂
First, go ahead and enable the Developer Tab (File -> Customize ribbon -> Main Tabs -> check the Developer tab)
On the Developer Tab, go to Insert -> button and draw yourself a button on the sheet.
When the window pops up asking about a macro, just click New
and paste this code right between the Sub and end Sub lines:
Dim counter As Integer
For counter = 1 To 10
If (Worksheets("Sheet1").Cells(counter, 1).Value > Worksheets("Sheet1").Cells(counter, 2).Value) Then
Worksheets("Sheet1").Cells(1, 3).Value = Worksheets("Sheet1").Cells(1, 3).Value + 1
End If
Next counter
Once you click that button, it’ll perform exactly what you’re looking for.
If you need to run it over a larger range, just look at the line "For counter = 1 To 10",
swap out the number 10 for whatever number you actually need,
Let me know if it works for you.