PC Review


Reply
Thread Tools Rate Thread

array formula

 
 
RN Mark
Guest
Posts: n/a
 
      25th Aug 2008
I want to use an array formula to count any value in one column that does not
match the corresponding value in the previous column, however, sum of the
cell values are results of formulae and I do not want to include these cells
in the count
 
Reply With Quote
 
 
 
 
Sandy Mann
Guest
Posts: n/a
 
      25th Aug 2008
Would a UDF do?

If so try

Function AddIt(r As Range) As Double
Application.Volatile

For Each cell In r
If cell.Value = Cells(cell.Row, cell.Column).Offset(0, 1).Value Then
If Not cell.HasFormula Then
AddIt = AddIt + cell.Value
End If
End If

Next cell
End Function


Enter it in the spreadsheet as

=AddIt(G10:G20)

and it will sum the cells that have a dubplicate to their right but not if
the cell in G10:G20 has a formula.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(E-Mail Removed)
Replace @mailinator.com with @tiscali.co.uk


"RN Mark" <(E-Mail Removed)> wrote in message
news:5B778FB4-6462-4961-B08B-(E-Mail Removed)...
>I want to use an array formula to count any value in one column that does
>not
> match the corresponding value in the previous column, however, sum of the
> cell values are results of formulae and I do not want to include these
> cells
> in the count
>



 
Reply With Quote
 
RN Mark
Guest
Posts: n/a
 
      27th Aug 2008
Thanks Sandy, I could not figure how to use the UDF for my purpose, I got
around my problem by creating array formula for every section of the
spreadsheet, thus missing out all the rows that were results of formula's. I
will be looking into how to use UDF's with ither spreadsheets I have.

"Sandy Mann" wrote:

> Would a UDF do?
>
> If so try
>
> Function AddIt(r As Range) As Double
> Application.Volatile
>
> For Each cell In r
> If cell.Value = Cells(cell.Row, cell.Column).Offset(0, 1).Value Then
> If Not cell.HasFormula Then
> AddIt = AddIt + cell.Value
> End If
> End If
>
> Next cell
> End Function
>
>
> Enter it in the spreadsheet as
>
> =AddIt(G10:G20)
>
> and it will sum the cells that have a dubplicate to their right but not if
> the cell in G10:G20 has a formula.
>
> --
> HTH
>
> Sandy
> In Perth, the ancient capital of Scotland
> and the crowning place of kings
>
> (E-Mail Removed)
> Replace @mailinator.com with @tiscali.co.uk
>
>
> "RN Mark" <(E-Mail Removed)> wrote in message
> news:5B778FB4-6462-4961-B08B-(E-Mail Removed)...
> >I want to use an array formula to count any value in one column that does
> >not
> > match the corresponding value in the previous column, however, sum of the
> > cell values are results of formulae and I do not want to include these
> > cells
> > in the count
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array formula SUMIF with 2D sum_range array Rich_84 Microsoft Excel Worksheet Functions 3 3rd Apr 2009 10:46 PM
Array formula: how to join 2 ranges together to form one array? Rich_84 Microsoft Excel Worksheet Functions 2 1st Apr 2009 06:38 PM
Difference between results of array formula and non-array, with IF(ISNUMBER) THOMAS CONLON Microsoft Excel Discussion 3 27th Aug 2006 10:22 PM
Tricky array formula issue - Using array formula on one cell, then autofilling down a range aspenbordr Microsoft Excel Programming 0 27th Jul 2005 03:59 PM
Array Formula - Use of OFFSET function with array argument Alan Microsoft Excel Worksheet Functions 2 11th Feb 2004 09:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:34 PM.