Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Can someone help me with this sumif formula

MXT is the range that contains the sunif criteria. it dosent like the offset
I commented out the R1C1 formula below so it might be easier for you to follow

Thanks

Sub Sumif_Test()
MXT = Range("MXT")
For X = 20 To 30
For Y = 1 To 3
Cells(X, Y).Value = Application.SumIf(MXT, Cells(18, Y), Offset(MXT,
Cells(X, 4), MXT.Rows.Count, 1))
Next Y
Next X

' This is thr R1C! equivalent of the formula I'm trying to create.
'ActiveCell.FormulaR1C1 =
"=SUMIF(MXT,R[-13]C4,OFFSET(MXT,0,R[-15]C,ROWS(MXT),1))"
End Sub


--
Helping Is always a good thing
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Can someone help me with this sumif formula

When you have a working formula, just use the formula:

Sub Sumif_Test2()
Dim MXT As Range
Set MXT = Range("MXT")

With Range(Cells(20, 1), Cells(30, 3))
.FormulaR1C1 = "=SUMIF(MXT,R[-13]C4,OFFSET(MXT,0,R[-15]C,ROWS(MXT),1))"
.Value = .Value
End With

End Sub

HTH,
Bernie
MS Excel MVP


"QuietMan" wrote in message
...
MXT is the range that contains the sunif criteria. it dosent like the offset
I commented out the R1C1 formula below so it might be easier for you to follow

Thanks

Sub Sumif_Test()
MXT = Range("MXT")
For X = 20 To 30
For Y = 1 To 3
Cells(X, Y).Value = Application.SumIf(MXT, Cells(18, Y), Offset(MXT,
Cells(X, 4), MXT.Rows.Count, 1))
Next Y
Next X

' This is thr R1C! equivalent of the formula I'm trying to create.
'ActiveCell.FormulaR1C1 =
"=SUMIF(MXT,R[-13]C4,OFFSET(MXT,0,R[-15]C,ROWS(MXT),1))"
End Sub


--
Helping Is always a good thing



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Can someone help me with this sumif formula

Thanks
--
Helping Is always a good thing


"Bernie Deitrick" wrote:

When you have a working formula, just use the formula:

Sub Sumif_Test2()
Dim MXT As Range
Set MXT = Range("MXT")

With Range(Cells(20, 1), Cells(30, 3))
.FormulaR1C1 = "=SUMIF(MXT,R[-13]C4,OFFSET(MXT,0,R[-15]C,ROWS(MXT),1))"
.Value = .Value
End With

End Sub

HTH,
Bernie
MS Excel MVP


"QuietMan" wrote in message
...
MXT is the range that contains the sunif criteria. it dosent like the offset
I commented out the R1C1 formula below so it might be easier for you to follow

Thanks

Sub Sumif_Test()
MXT = Range("MXT")
For X = 20 To 30
For Y = 1 To 3
Cells(X, Y).Value = Application.SumIf(MXT, Cells(18, Y), Offset(MXT,
Cells(X, 4), MXT.Rows.Count, 1))
Next Y
Next X

' This is thr R1C! equivalent of the formula I'm trying to create.
'ActiveCell.FormulaR1C1 =
"=SUMIF(MXT,R[-13]C4,OFFSET(MXT,0,R[-15]C,ROWS(MXT),1))"
End Sub


--
Helping Is always a good thing




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nesting a sumproduct formula within a sumif formula. jerrymcm Excel Discussion (Misc queries) 2 October 3rd 07 03:35 PM
multiply formula where 1 cell has a (sumif) formula as a result kcip Excel Worksheet Functions 1 May 3rd 07 07:41 AM
sumif formula Louie Excel Worksheet Functions 5 April 4th 07 03:32 AM
Embed AND formula in SUMIF formula Tinkerbell1178 Excel Discussion (Misc queries) 1 February 21st 07 07:29 AM
Is there a MAXIF formula similar to the SUMIF formula? tlc Excel Discussion (Misc queries) 2 March 13th 06 08:07 PM


All times are GMT +1. The time now is 11:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"