Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
nascarjc
 
Posts: n/a
Default Help to understand "IF" code


Hello all,
This is the first time in here. I have a question about a line of code
which has today() and weekday() in it. Can someone explain this for me
so that I may understand it better? The person who did it can't
explain it so hopefully you can. Thanks in advance.

=IF(E8="HO","HO",IF(E5=12,"X",IF((TODAY()+1)E6,IF ((WEEKDAY(E6,2)5),"",IF(E8="OT","OT",IF(E9="FH",8 ,IF(E5=11,8,9)))),"")))

JC


--
nascarjc
------------------------------------------------------------------------
nascarjc's Profile: http://www.excelforum.com/member.php...o&userid=31002
View this thread: http://www.excelforum.com/showthread...hreadid=506697

  #2   Report Post  
Posted to microsoft.public.excel.newusers
Dav
 
Posts: n/a
Default Help to understand "IF" code


=IF(E8="HO","HO",IF(E5=12,"X",IF((TODAY()+1)E6,IF
((WEEKDAY(E6,2)5),"",IF(E8="OT","OT",IF(E9="FH",8
,IF(E5=11,8,9)))),"")))

Today() is a function which returns today's date

Weekday is a function which returns the day in a week from 1 to7 , the
2 parameter just means that monday is 1 through to sunday is 7

So if E8 equals HO return HO
Else if E5 equals 12 return X
Else if tomorrow (today +1) is greater than E6 and E6 is a Friday
return blank
Else if tomorrow (today +1) is greater than E6 and E8 equals OT return
OT
Else if Else if tomorrow (today +1) is greater than E6 and E9 equals FH
return 8
Else if tomorrow (today +1) is greater than E6 and E5 equals 11 return
8
Else if tomorrow (today +1) is greater than E6 Return 9
Else return blank

it is probably worth populating the cells E5 E6 E8 E9 and checking if
the above logic holds. Nested if statements are not easy to read in
excel especially if you did not write them in the first place!

Hope this helps

Dav

Return blank


--
Dav
------------------------------------------------------------------------
Dav's Profile: http://www.excelforum.com/member.php...o&userid=27107
View this thread: http://www.excelforum.com/showthread...hreadid=506697

  #3   Report Post  
Posted to microsoft.public.excel.newusers
nascarjc
 
Posts: n/a
Default Help to understand "IF" code


Dav,
Thanks for your help in understanding the formula. The way you put it,
it makes more sense to me. I now want to modify this formula and now
that I understand it more I should be able to do it.

James:)


--
nascarjc
------------------------------------------------------------------------
nascarjc's Profile: http://www.excelforum.com/member.php...o&userid=31002
View this thread: http://www.excelforum.com/showthread...hreadid=506697

  #4   Report Post  
Posted to microsoft.public.excel.newusers
nascarjc
 
Posts: n/a
Default Help to understand "IF" code


Dav,
Thanks for your help in understanding the formula. The way you put it,
it makes more sense to me. I now want to modify this formula and now
that I understand it more I should be able to do it.

James:)


--
nascarjc
------------------------------------------------------------------------
nascarjc's Profile: http://www.excelforum.com/member.php...o&userid=31002
View this thread: http://www.excelforum.com/showthread...hreadid=506697

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
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 09:53 PM
Opening a file with code without a set file name jenkinspat Excel Discussion (Misc queries) 1 March 4th 05 11:50 AM


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