Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
MikeL
 
Posts: n/a
Default How can I have multiple "If" statements in one formula?

I would like to write a formula that looks at one cell and sees if there is a
certain letter, R, L or C. and depending on what letter is there it would add
so many days to another date. I am sure I did it before but I do not
remember how I did it. Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer
 
Posts: n/a
Default How can I have multiple "If" statements in one formula?

=if(a1="R",5,if(a1="L",7,if(a1="C",10,"input error")))
If you've got more than three or four such conditions, you'll be better
served by using a vlookup.

"MikeL" wrote:

I would like to write a formula that looks at one cell and sees if there is a
certain letter, R, L or C. and depending on what letter is there it would add
so many days to another date. I am sure I did it before but I do not
remember how I did it. Can anyone help?

  #3   Report Post  
Posted to microsoft.public.excel.misc
SVC
 
Posts: n/a
Default How can I have multiple "If" statements in one formula?

Use a nested IF statement. Say the original date is in cell A1 and the
letter R, L, or C is in B1 and you want to add 1 for R, 2 for L and 3 for C,
in cell C1 (which should be formatted as a Date) enter the formula
=IF(B1="R",A1+1,IF(B1="L",A1+2,IF(B1="C",A1+3)))

Modify the formula to reflect the correct cells and the desired additional
days.

"MikeL" wrote:

I would like to write a formula that looks at one cell and sees if there is a
certain letter, R, L or C. and depending on what letter is there it would add
so many days to another date. I am sure I did it before but I do not
remember how I did it. Can anyone help?

  #4   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier
 
Posts: n/a
Default How can I have multiple "If" statements in one formula?

Hi Mike

Supposing your date in B1 and the value you are testing is in A1.
Assuming want to add say 5 days for R, 3 days for L or 7 days for C
=B1+5*(A1="R")+3*(A1="L")+7*(A1="C")

--
Regards

Roger Govier


"MikeL" wrote in message
...
I would like to write a formula that looks at one cell and sees if
there is a
certain letter, R, L or C. and depending on what letter is there it
would add
so many days to another date. I am sure I did it before but I do not
remember how I did it. Can anyone help?



  #5   Report Post  
Posted to microsoft.public.excel.misc
paul
 
Posts: n/a
Default How can I have multiple "If" statements in one formula?

one way
in another cell say b1 =if(a1="R",1,if(a1="L",2,3))
in another cell have =another date+B1
--
paul
remove nospam for email addy!



"MikeL" wrote:

I would like to write a formula that looks at one cell and sees if there is a
certain letter, R, L or C. and depending on what letter is there it would add
so many days to another date. I am sure I did it before but I do not
remember how I did it. Can anyone help?



  #6   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default How can I have multiple "If" statements in one formula?


Try this formula

=B1+LOOKUP(A1,{"C","L","R";1,2,3})


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=501254

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
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula to delete blank cells across multiple columns? SamFunMail Excel Worksheet Functions 2 September 1st 05 07:05 AM
How do I copy a reference formula onto multiple worksheets Nina@ramaz Excel Worksheet Functions 1 July 21st 05 03:39 PM
How to: Multiple "if" statements? Hosh New Users to Excel 2 June 29th 05 02:20 PM
apply a formula to multiple cells FixitFrog Excel Discussion (Misc queries) 3 June 23rd 05 11:54 AM


All times are GMT +1. The time now is 03:00 AM.

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"