![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: CHESTER, ENGLAND
Posts: 72
|
Please could someone help me with an IF STATEMENT, to me it seems impossible, but after seeing some of the IF STATEMENTS queries solved lately on this FORUM. I thought I would give this one a try.
What I am trying to do is this: IF(C1&C2=”HOL”,”SICK”,”STUDY”, then the value of cell APRIL 02 B20) IF NONE OF THE ABOVE APPLY THEN FOLLOW ON TO IF(C1&C2=”UN-PAY”,”FLEXI”, then the value of 00:00) IF NONE OF THE ABOVE APPLY THEN FOLLOW ON TO C2-C1 I’m desperate for an answer!!!!!!!! CHRIS |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
|
Not sure if I read this right, but try
=IF(AND(OR(C1={"hol","sick","study"}),OR(C2={"hol","sick","study"})),B20,IF(AND(OR(C1={"un-pay","Flexi"}),OR(C2={"un-pay","Flexi"})),0,C2-C1)) Note: This produces an error if say C1 is HOL and C2 is flexi |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Hi Chris,
Try, =IF(AND(OR(C1={"HOL","SICK","STUDY"}),OR(C2={"HOL","SICK","STUDY"})),'APRIL 02'!B20,IF(AND(OR(C1={"UN-PAY","FLEXI"}),OR(C2={"UN-PAY","FLEXI"})),0,C2-C1)) Unsure if this will work. What happens if the person goes home sick at midday for instance. You want to be able to pay them for the half day and pay them for the half sick day, right? Need a few more specifics how you are handling the others scenarios. HTH, Jay |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
Hiya,
If I interpreted correctly you want the OR statement: =If(OR(C1&C2="HOL",C1&C2="Sick",C1&C2="Study"),B20,IF(OR(C1&C2="UN-PAY",C1&C2="FLEXI"),00:00),c2-c1)) Hope that helps out. Adam |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: CHESTER, ENGLAND
Posts: 72
|
Thanks IML & JAY & ADAM
I will now test out out all 3 solutions CHRIS |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|