3 IF statements for a cell??

locolindo

New Member
Joined
Dec 5, 2014
Messages
12
Hi There,
I have a table with hospital admission date (column A), discharge date (column B), and a third column that calculates the duration of stay (column C).
Sometimes, people forget to enter data for either the admission date (column A), or the discharge date (column B), or both (columns A & B)!!!
I would like to create a function for column C that does the following:

Column AColumn BColumn C
Admission DateDischarge DateLenght of Stay
NO DATADATA"No Admission Date"
DATANO DATA"Ongoing"
NO DATANO DATA"No Data for Admission or Discharge"
DATADATACalculates B-A (easy!!!)

<tbody>
</tbody>

Can such a function be done all for one cell?
Thank you!!!
Locolindo
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi,

Using IF statements:


Book1
ABCD
1Admission DateDischarge DateLength of StayLength of Stay
26/1/2018No Admission DateNo Admission Date
35/15/2018OngoingOngoing
4No Data for Admission and DischargeNo Data for Admission and Discharge
55/15/20186/1/20181718
Sheet73
Cell Formulas
RangeFormula
C2=IF(AND(A2="",B2=""),"No Data for Admission and Discharge",IF(A2="","No Admission Date",IF(B2="","Ongoing",B2-A2)))
D2=IF(AND(A2="",B2=""),"No Data for Admission and Discharge",IF(A2="","No Admission Date",IF(B2="","Ongoing",B2-A2+1)))


If the length of stay should be Admission/Discharge Day Inclusive, use D2 formula, otherwise use C2 formula.

Either way, formula copied down.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,559
Members
448,970
Latest member
kennimack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top