Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 2 formulas to use depending on value of another cell

Are you sure you need VBA??:
=IF(Q2="travel",ROUND((Y2/117.5*100),2),ROUND((Y2/105*100),2))

--
Gary''s Student - gsnu200857


"Sarah (OGI)" wrote:

Using vba code in Excel 2003, is there any way of calculating a certain
formula in one, depending on the value of another cell?

For example, if Q2 contains the word 'travel', I want the following formula
to operate in Z2: =round((Y2/117.5*100),2).
If Q2 doesn't contain the word 'travel', I would like Z2 to use the formula:
=round((Y2/105*100),2).

I would then like to extend this down to last available row (which may be
different each time it is run).

Any ideas?

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
Inserting formulas depending on a variable Alexander Excel Programming 2 January 8th 09 02:08 PM
FORMULAS THAT CAN HAVE DIFFERENT ANSWERS DEPENDING ON DATA INPUT Dawn Excel Worksheet Functions 4 December 21st 06 10:59 PM
How can i change cell colour depending on month of date in cell? andy75 Excel Discussion (Misc queries) 2 January 6th 06 07:46 AM
How do I change the color of a cell depending on the result of the function in that cell Mo Childs[_2_] Excel Programming 4 November 1st 05 09:30 PM
Automated cell copy depending on cell content? Joachim Fabini Excel Programming 5 November 20th 03 07:54 AM


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