LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default SumIf Calculation in Code Problem

I think this is what you need

ActiveWorkbook.Sheets("Sheet1").Cells(i, 3).Value = _
ActiveWorkbook.Sheets("Sheet1").Cells(i, 1) / _
Application.SumIf(ActiveWorkbook.Sheets("Sheet1"). Columns(2), _
"<" & XXX, ActiveWorkbook.Sheets("Sheet1").Columns(1))

The < is a string and XXX is a variable which is a number. The & combines
a strinhg and a number and makes the results a string.


"Arturo" wrote:

ActiveWorkbook.Sheets("Sheet1").Cells(i, 3).Value = _
ActiveWorkbook.Sheets("Sheet1").Cells(i, 1) / _
Application.SumIf(ActiveWorkbook.Sheets("Sheet1"). Columns(2), _
"<XXX", ActiveWorkbook.Sheets("Sheet1").Columns(1))

The above code works but, the problem Im encountering has to do with
factoring in a number associated with a variable, X, into the denominator of
this formula. X resides elsewhere, I can pull it with no problem. Whatever
SumIf of column 1 is, I want to add X to that summation but am not finding
the correct syntax to do so. Any direction would be appreciated.

Arturo

 
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
Limitations on Sumif Calculation TaraD[_2_] Excel Worksheet Functions 3 January 26th 10 10:50 PM
Help to create calculation with code Les Stout[_2_] Excel Programming 0 April 7th 08 12:19 PM
Calculation on SUMIF Results Andy B Excel Worksheet Functions 3 October 9th 05 04:47 AM
SUMIF function in "Price quote with tax calculation" templae Peter Excel Worksheet Functions 6 October 3rd 05 07:18 PM
Code Calculation Problem Shawn Excel Programming 16 July 20th 05 06:12 PM


All times are GMT +1. The time now is 09:50 PM.

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"