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

I am creating the following Excel function

Function BlendFlashPt_degF(volpct_data As Range, CompFlashPt_degF As
Range) As Variant

Dim FPI As Double

FPI = Application.WorksheetFunction.SumProduct(volpct_da ta, 10 ^
(-6.1188 + (4345.2 / ((CompFlashPt_degF) + 383))))

BlendFlashPt_degF = (4345.2 / (Log(FPI) / 2.302585092994 + 6.1188)) -
383

End Function

But, I am getting

run-time error 13
'type mismatch'

on the line
FPI = Application.WorksheetFunction.SumProduct(volpct_da ta, 10 ^
(-6.1188 + (4345.2 / ((CompFlashPt_degF) + 383))))

However, when I typed this formula

SUMPRODUCT(B17:M17,10^(-6.1188+(4345.2/((B37:M37)+383))))

into Excel's formula bar it worked.
where B17:M17 represents volpct_data
B37:M37 represents CompFlashPt_degF

What I am doing wrong in my user-defined function?

Please Help!
Thanks!


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default SumProduct function

Try this

Replace

FPI = Application.WorksheetFunction.SumProduct(volpct_da ta, 10 ^ (-6.1188 +
(4345.2 / ((CompFlashPt_degF) + 383))))

with

FPI = Application.Evaluate("SumProduct(" & volpct_data.Address & _
", 10 ^ (-6.1188 + (4345.2 / ((" & CompFlashPt_degF.Address & ") +
383))))")


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"21MSU " wrote in message
...
I am creating the following Excel function

Function BlendFlashPt_degF(volpct_data As Range, CompFlashPt_degF As
Range) As Variant

Dim FPI As Double

FPI = Application.WorksheetFunction.SumProduct(volpct_da ta, 10 ^
(-6.1188 + (4345.2 / ((CompFlashPt_degF) + 383))))

BlendFlashPt_degF = (4345.2 / (Log(FPI) / 2.302585092994 + 6.1188)) -
383

End Function

But, I am getting

run-time error 13
'type mismatch'

on the line
FPI = Application.WorksheetFunction.SumProduct(volpct_da ta, 10 ^
(-6.1188 + (4345.2 / ((CompFlashPt_degF) + 383))))

However, when I typed this formula

SUMPRODUCT(B17:M17,10^(-6.1188+(4345.2/((B37:M37)+383))))

into Excel's formula bar it worked.
where B17:M17 represents volpct_data
B37:M37 represents CompFlashPt_degF

What I am doing wrong in my user-defined function?

Please Help!
Thanks!


---
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
Sumproduct with Condition OR Sumproduct with ADDRESS function - HE gholly Excel Discussion (Misc queries) 2 September 28th 09 05:07 PM
sumproduct function / VB user defined function aw Excel Discussion (Misc queries) 3 September 23rd 08 09:05 AM
SUMPRODUCT or another function??? Paul Groth Excel Worksheet Functions 2 May 7th 08 02:30 PM
use of sumproduct function R..VENKATARAMAN Excel Worksheet Functions 4 January 23rd 06 02:33 AM
SUMIF Function Inside SUMPRODUCT Function Abdul Waheed Excel Worksheet Functions 17 September 19th 05 04:24 PM


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