Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default IF function based on True result with large formula.

I have a massive formula that I use to figure up vacation accumulation for
certain employees. Now I have to run the same formula EXCEPT it only needs
to be ran if the employee has worked 140 hrs. How can I incorporate that
into my formula??? Below is my formula-

IF A2 is =140 then

formula:
-------------------------------------------------------------------------------
=IF(AND(DAY(TODAY())=DAY(A3),YEAR(TODAY())=YEAR(A 3)),(MONTH(TODAY())-MONTH(A3))*3.34,IF(AND(DAY(TODAY())<DAY(A3),YEAR(T ODAY())=YEAR(A3)),(MONTH(TODAY())-(MONTH(A3)+1))*3.34,IF(AND(YEAR(TODAY()YEAR(A3)), (YEAR(TODAY())-YEAR(A3)<10),DAY(TODAY())=DAY(A3)),(((MONTH(TODAY ()))*(80/12))+((12-MONTH(A3))*3.34)+((YEAR(TODAY())-(YEAR(A3)+1))*80)),IF(AND(YEAR(TODAY()YEAR(A3)),( YEAR(TODAY())-YEAR(A3)<10),DAY(TODAY())<DAY(A3)),(((MONTH(TODAY( ))-1)*(80/12))+((12-MONTH(A3))*3.34)+((YEAR(TODAY())-(YEAR(A3)+1))*80)),"N/A"))))
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default IF function based on True result with large formula.

the formula is too long. try to put it into a UDF , and teh a simple IF
would work.

what is the intent on the formula - looks like a date calculation - and many
people here have a lot of experience that mightoffer a better solution.

"naiveprogrammer" wrote:

I have a massive formula that I use to figure up vacation accumulation for
certain employees. Now I have to run the same formula EXCEPT it only needs
to be ran if the employee has worked 140 hrs. How can I incorporate that
into my formula??? Below is my formula-

IF A2 is =140 then

formula:
--------------------------------------------------------------------------------
=IF(AND(DAY(TODAY())=DAY(A3),YEAR(TODAY())=YEAR(A 3)),(MONTH(TODAY())-MONTH(A3))*3.34,IF(AND(DAY(TODAY())<DAY(A3),YEAR(T ODAY())=YEAR(A3)),(MONTH(TODAY())-(MONTH(A3)+1))*3.34,IF(AND(YEAR(TODAY()YEAR(A3)), (YEAR(TODAY())-YEAR(A3)<10),DAY(TODAY())=DAY(A3)),(((MONTH(TODAY ()))*(80/12))+((12-MONTH(A3))*3.34)+((YEAR(TODAY())-(YEAR(A3)+1))*80)),IF(AND(YEAR(TODAY()YEAR(A3)),( YEAR(TODAY())-YEAR(A3)<10),DAY(TODAY())<DAY(A3)),(((MONTH(TODAY( ))-1)*(80/12))+((12-MONTH(A3))*3.34)+((YEAR(TODAY())-(YEAR(A3)+1))*80)),"N/A"))))

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default IF function based on True result with large formula.

The intent of the formula is to track the accrued vacation time for each
employee per their hire date. *During 1st year vacation employee will
accumulate at 3.34 a day for every month of service. (ie hire date = March 3,
2005- start accumulating April 3, 2005)*

Also I'm not familiar with UDF, what is this?

Thanks for replying!!!


"Patrick Molloy" wrote:

the formula is too long. try to put it into a UDF , and teh a simple IF
would work.

what is the intent on the formula - looks like a date calculation - and many
people here have a lot of experience that mightoffer a better solution.

"naiveprogrammer" wrote:

I have a massive formula that I use to figure up vacation accumulation for
certain employees. Now I have to run the same formula EXCEPT it only needs
to be ran if the employee has worked 140 hrs. How can I incorporate that
into my formula??? Below is my formula-

IF A2 is =140 then

formula:
--------------------------------------------------------------------------------
=IF(AND(DAY(TODAY())=DAY(A3),YEAR(TODAY())=YEAR(A 3)),(MONTH(TODAY())-MONTH(A3))*3.34,IF(AND(DAY(TODAY())<DAY(A3),YEAR(T ODAY())=YEAR(A3)),(MONTH(TODAY())-(MONTH(A3)+1))*3.34,IF(AND(YEAR(TODAY()YEAR(A3)), (YEAR(TODAY())-YEAR(A3)<10),DAY(TODAY())=DAY(A3)),(((MONTH(TODAY ()))*(80/12))+((12-MONTH(A3))*3.34)+((YEAR(TODAY())-(YEAR(A3)+1))*80)),IF(AND(YEAR(TODAY()YEAR(A3)),( YEAR(TODAY())-YEAR(A3)<10),DAY(TODAY())<DAY(A3)),(((MONTH(TODAY( ))-1)*(80/12))+((12-MONTH(A3))*3.34)+((YEAR(TODAY())-(YEAR(A3)+1))*80)),"N/A"))))

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default IF function based on True result with large formula.

UDF is User Defined Function
It will enable you to break your formula down so much more easily

"naiveprogrammer" wrote in
message ...
The intent of the formula is to track the accrued vacation time for each
employee per their hire date. *During 1st year vacation employee will
accumulate at 3.34 a day for every month of service. (ie hire date = March
3,
2005- start accumulating April 3, 2005)*

Also I'm not familiar with UDF, what is this?

Thanks for replying!!!


"Patrick Molloy" wrote:

the formula is too long. try to put it into a UDF , and teh a simple IF
would work.

what is the intent on the formula - looks like a date calculation - and
many
people here have a lot of experience that mightoffer a better solution.

"naiveprogrammer" wrote:

I have a massive formula that I use to figure up vacation accumulation
for
certain employees. Now I have to run the same formula EXCEPT it only
needs
to be ran if the employee has worked 140 hrs. How can I incorporate
that
into my formula??? Below is my formula-

IF A2 is =140 then

formula:
--------------------------------------------------------------------------------
=IF(AND(DAY(TODAY())=DAY(A3),YEAR(TODAY())=YEAR(A 3)),(MONTH(TODAY())-MONTH(A3))*3.34,IF(AND(DAY(TODAY())<DAY(A3),YEAR(T ODAY())=YEAR(A3)),(MONTH(TODAY())-(MONTH(A3)+1))*3.34,IF(AND(YEAR(TODAY()YEAR(A3)), (YEAR(TODAY())-YEAR(A3)<10),DAY(TODAY())=DAY(A3)),(((MONTH(TODAY ()))*(80/12))+((12-MONTH(A3))*3.34)+((YEAR(TODAY())-(YEAR(A3)+1))*80)),IF(AND(YEAR(TODAY()YEAR(A3)),( YEAR(TODAY())-YEAR(A3)<10),DAY(TODAY())<DAY(A3)),(((MONTH(TODAY( ))-1)*(80/12))+((12-MONTH(A3))*3.34)+((YEAR(TODAY())-(YEAR(A3)+1))*80)),"N/A"))))



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
Problems creating a result based on 2 cells being true.. Lucky[_3_] Excel Worksheet Functions 3 May 31st 08 01:49 PM
True number as the result to an If-Then function kingham78 Excel Discussion (Misc queries) 2 October 12th 06 12:09 PM
True number as the result to an If-Then function kingham Excel Discussion (Misc queries) 0 October 11th 06 10:28 PM
True number as the result to an If-Then function kingham Excel Discussion (Misc queries) 0 October 11th 06 10:27 PM
Can Excel operate a function based on a true or false result? SteveD Excel Worksheet Functions 1 August 26th 05 01:47 PM


All times are GMT +1. The time now is 11:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"