Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Array Formula in VBA

Hi!VBA expert,

I need some help in coding the formula below.

I have the below code in a module. The first part is working for co
“L”.
result = 0
result = Application.WorksheetFunction.Sum(Range("A" & myRow, "J"
myRow))
Cells(myRow, 12).Value = result

In col “M” I like to add in the below formula, but don’t know how t
code it in VBA.

Array Formula = SUM(IF(A1:G1=100,IF(A1:G1<=199.99,1,0)))

Can someone tell me how to do it?

Thanks,
Michae

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Array Formula in VBA

If you want to count the number of cells that meet the 100 to 20
criteria,
=COUNTIF(A1:G1,"=100")-COUNTIF(A1:G1,"200")

If you want to add the numbers,
=SUMIF(A1:G1,"=100")-SUMIF(A1:G1,"200")

-gitcyphe

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Array Formula in VBA

Hi!gitcypher,

Thanks for the answer.

Regards,
Michael

gitcypher wrote:
*If you want to count the number of cells that meet the 100 to 20
criteria,
application.worksheetfunction.COUNTIF(A1:G1,"=100 ")-application.worksheetfunction.COUNTIF(A1:G1,"200" )

If you want to add the numbers,
application.worksheetfunction.SUMIF(A1:G1,"=100")-application.worksheetfunction.SUMIF(A1:G1,"200")

-gitcypher


--
Message posted from http://www.ExcelForum.com

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
Array formula SUMIF with 2D sum_range array Rich_84 Excel Worksheet Functions 3 April 3rd 09 10:46 PM
Array formula: how to join 2 ranges together to form one array? Rich_84 Excel Worksheet Functions 2 April 1st 09 06:38 PM
Find specific value in array of array formula DzednConfsd Excel Worksheet Functions 2 January 13th 09 06:19 AM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Array Formula - using LEFT("text",4) in formula Andrew L via OfficeKB.com Excel Worksheet Functions 2 August 1st 05 02:36 PM


All times are GMT +1. The time now is 06:05 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"