Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jimtodd
 
Posts: n/a
Default sum if cell contains a formula

How cant I add a collum of data but only cells with a formula in.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default sum if cell contains a formula

=SUMPRODUCT(--IsFormula(A1:A100))

and add this UDF

'---------------------------------------------------------------------
Function IsFormula(rng As Range) As Variant
'---------------------------------------------------------------------
Dim cell As Range, row As Range
Dim i As Long, j As Long
Dim aryFormulae As Variant

If rng.Areas.Count 1 Then
aryFormulae = CVErr(xlErrValue)
Exit Function
End If

If rng.Cells.Count = 1 Then
aryFormulae = rng

Else
aryFormulae = rng.Value
i = 0

For Each row In rng.Rows
i = i + 1
j = 0

For Each cell In row.Cells
j = j + 1

aryFormulae(i, j) = cell.HasFormula

Next cell

Next row

End If

IsFormula = aryFormulae

End Function



--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"jimtodd" wrote in message
...
How cant I add a collum of data but only cells with a formula in.



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
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Creating a check mark box MarthaSue Setting up and Configuration of Excel 18 April 28th 05 12:31 AM
put formula results into a different cell if it is empty PutFormula Excel Worksheet Functions 2 February 11th 05 03:31 AM
Cell shows formula and not the result of the formula. stumpy1220 Excel Worksheet Functions 2 January 14th 05 05:11 PM
looking for a formula Amanda Excel Worksheet Functions 5 January 5th 05 07:37 AM


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