View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
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?