Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Using SumIF with an array

I export from Access to text and then import into Excel, the export from
Access truncates some ending characters. To offset this I have to sum some
records once I get it to Excel but am having trouble with the following sumif

If the value in column D is a Month (January, February etc) then sum only
those rows in column Q. I have figured it out as an Excel formula but how is
this converted to vb?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Using SumIF with an array

It would have been helpful if you posted your formula... then I wouldn't
have to ask you exactly what is in Column D... the month name as a spelled
out text word or the number of the month?

--
Rick (MVP - Excel)


"jeremiah" wrote in message
...
I export from Access to text and then import into Excel, the export from
Access truncates some ending characters. To offset this I have to sum
some
records once I get it to Excel but am having trouble with the following
sumif

If the value in column D is a Month (January, February etc) then sum only
those rows in column Q. I have figured it out as an Excel formula but how
is
this converted to vb?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Using SumIF with an array

Sorry, the formula is below. I need to be able to do this in a worksheet
that will vary in number of rows which is why I am using vb - I figured this
out by identifying a range but will adjust it to use with an array of January
through December eventually. I know I will have to use the lastrow function
but was trying to figure this part out first.

=SUMIF(D1:D20,"January",Q1:Q20)+SUMIF(D1:D20,"Febr uary",Q1:Q20)


"Rick Rothstein" wrote:

It would have been helpful if you posted your formula... then I wouldn't
have to ask you exactly what is in Column D... the month name as a spelled
out text word or the number of the month?

--
Rick (MVP - Excel)


"jeremiah" wrote in message
...
I export from Access to text and then import into Excel, the export from
Access truncates some ending characters. To offset this I have to sum
some
records once I get it to Excel but am having trouble with the following
sumif

If the value in column D is a Month (January, February etc) then sum only
those rows in column Q. I have figured it out as an Excel formula but how
is
this converted to vb?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Using SumIF with an array

I have the following working...is there a way to use an array rather than
having to add new code for each month?

Sub OffsetSumTestDecks()
Dim Cell As Range
Sub OffsetSumTestDecks()
Dim Cell As Range
' Macro8 Macro
' Macro recorded 1/13/2009 by PEDCS Workstation

For Each Cell In Range("d:d")
If Cell.Value = "Year To Date" Then
Cell.Offset(0, 13) =
"=SUMIF(R[-14]C[-13]:R[5]C[-13],""January"",R[-14]C:R[5]C)+SUMIF(R[-14]C[-13]:R[5]C[-13],""February"",R[-14]C:R[5]C)+SUMIF(R[-14]C[-13]:R[5]C[-13],""March"",R[-14]C:R[5]C)"
End If
Next Cell



"jeremiah" wrote:

Sorry, the formula is below. I need to be able to do this in a worksheet
that will vary in number of rows which is why I am using vb - I figured this
out by identifying a range but will adjust it to use with an array of January
through December eventually. I know I will have to use the lastrow function
but was trying to figure this part out first.

=SUMIF(D1:D20,"January",Q1:Q20)+SUMIF(D1:D20,"Febr uary",Q1:Q20)


"Rick Rothstein" wrote:

It would have been helpful if you posted your formula... then I wouldn't
have to ask you exactly what is in Column D... the month name as a spelled
out text word or the number of the month?

--
Rick (MVP - Excel)


"jeremiah" wrote in message
...
I export from Access to text and then import into Excel, the export from
Access truncates some ending characters. To offset this I have to sum
some
records once I get it to Excel but am having trouble with the following
sumif

If the value in column D is a Month (January, February etc) then sum only
those rows in column Q. I have figured it out as an Excel formula but how
is
this converted to vb?



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
3D array SUMIF BimboUK Excel Discussion (Misc queries) 2 October 20th 09 04:59 PM
Array formula SUMIF with 2D sum_range array Rich_84 Excel Worksheet Functions 3 April 3rd 09 10:46 PM
Sumif array? Doug Excel Worksheet Functions 1 November 14th 07 11:05 AM
and < for Array Sumif ({}) Kiwi Matt Excel Worksheet Functions 6 October 23rd 06 06:32 PM
use sumif with array pdberger Excel Worksheet Functions 3 June 22nd 05 09:12 PM


All times are GMT +1. The time now is 08:02 PM.

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

About Us

"It's about Microsoft Excel"