Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 7th, 2006, 04:41 AM
Registered User
 
Join Date: Aug 2006
Location: Albufeira, , Portugal.
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))

Reply With Quote
  #2 (permalink)  
Old August 7th, 2006, 05:46 AM
Authorized User
 
Join Date: Mar 2006
Location: London, , United Kingdom.
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

Reply With Quote
  #3 (permalink)  
Old August 7th, 2006, 06:18 AM
Registered User
 
Join Date: Aug 2006
Location: Albufeira, , Portugal.
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


Reply With Quote
  #4 (permalink)  
Old August 7th, 2006, 06:30 AM
Registered User
 
Join Date: Aug 2006
Location: Albufeira, , Portugal.
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.


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.