Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2006, 04:41 AM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default "If" function

Why the following excel formula keep giving me an error?

=IF (I26 = 1, THEN (G6*J29))

 
Old August 7th, 2006, 05:46 AM
Authorized User
 
Join Date: Mar 2006
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

change to

Code:
=if(I26=1,(G6*J29),0)
You dont need the 'Then' statement

 
Old August 7th, 2006, 06:18 AM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nop.

I tried as well even this:

=if(I26=1,G6*J29,if(I26=2,g6*K29,if(I26=3,g6*L29)) )

and

=INDEX(J29:Z29,I26)*G6

Still gives an error


 
Old August 7th, 2006, 06:30 AM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My friend


I found the reason that gives errors.
My excell is in Portuguese and the statement must be like this:

=SE(K26=1;$G6*$J29;SE(K26=2;$G6*K29;SE(K26=3;$G6*L 29))*0)

SE mean IF and have to use ; instead of ,

Just remember this for future.

Thanks a lot.







Similar Threads
Thread Thread Starter Forum Replies Last Post
function keyvanjan ASP.NET 2.0 Professional 1 September 19th, 2007 10:22 AM
How to use Function akumarp2p SQL Server 2000 1 May 28th, 2007 05:04 AM
send variable in function to another function schoolBoy Javascript How-To 6 March 3rd, 2007 09:16 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.