Working with a database where cells use numbers and letters. Trying to query from cells using IF, AND,OR without complete success.
[TABLE="width: 500, align: center"]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]PT Admit Status[/TD]
[TD="align: center"]Start Location[/TD]
DC/Transfer
[/td]OPS
[/td]OPS-IP
[/td]IP
[/td]
[TD="align: center"]2[/TD]
[TD="align: center"]OPS[/TD]
[TD="align: center"]OPS[/TD]
PACU Home
[/td]
[TD="align: center"]1[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]IP[/TD]
[TD="align: center"]M435[/TD]
M545
[/td]
[TD="align: center"]1[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]OPS[/TD]
[TD="align: center"]OPS[/TD]
OPS
[/td]
[TD="align: center"]1[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]OPS[/TD]
[TD="align: center"]E423[/TD]
E423
[/td]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]IP[/TD]
[TD="align: center"]M633[/TD]
M633
[/td]
[TD="align: center"]1[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]IP[/TD]
[TD="align: center"]A510[/TD]
M531
[/td]
[TD="align: center"]1[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]OPS[/TD]
[TD="align: center"]OPS[/TD]
PACU Home
[/td]
[TD="align: center"]1[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]OPS[/TD]
[TD="align: center"]OPS[/TD]
M537
[/td]
[TD="align: center"]1[/TD]
[/TABLE]
Column A represents patient admission status, Outpatient (OPS) or Inpatient (IP)
Column B represents patient location prior to procedure date. OPS if coming from home, ex M435 from hospital bed.
Column C represents patient discharge location after procedure.
Column D represents patient coming from home for the procedure and discharged home same day of the procedure (OPS).
Column E represents patient coming from home for the procedure and admitted to hospital bed after the procedure (OPS-IP).
Column F represents patient coming from a hospital bed and returning to hospital bed after the procedure (IP).
Trying to autofill columns D,E, and F using IF formula.
To autofill column D, patient will meet one of two criteria:
1. Admit status is OPS and discharged to OPS.
2. Admit status is OPS and discharged to PACU Home.
=IF(OR(A2="OPS",C2="OPS",C2="PACU Home"),1,"") *This formula works for me.
To autofill column E, patient will meet one criteria:
1. Admit status is OPS and admitted to hospital bed.
=IF(OR(A2="OPS",C2="OPS",C2="PACU Home"),"",1) *This formula does not work for me.
To autofill column F, patient will meet one criteria:
1. Admit status is IP and returns to hospital bed.
=IF(OR(A2="OPS",A2=""),"",1) *This formula works for me.
I don't understand why the formula for column E does not work. Do I add "AND" or is there an easier formula to accomplish the task?
Thank you in advance for your assistance.
Nestor