ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Average Length of Stay (https://www.excelbanter.com/excel-worksheet-functions/263537-average-length-stay.html)

Georgeb123

Average Length of Stay
 
Column A is Funding Source: "A" or "T"
Column B is Days of Stay calculated from check-out date minus check-in date.
How to calculate Column C as Average Length of Stay for "A"s?

Ashish Mathur[_2_]

Average Length of Stay
 
Hi,

Try this

=sumproduct((A2:A150="A")*(B2:B150))/countif(A2:A150,"A")

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Georgeb123" wrote in message
...
Column A is Funding Source: "A" or "T"
Column B is Days of Stay calculated from check-out date minus check-in
date.
How to calculate Column C as Average Length of Stay for "A"s?



Bernard Liengme[_2_]

Average Length of Stay
 
=SUMIF(A1:A26,"A",B1:B26)/COUNTIF(A1:A26,"A")
or, if you have Excel 2007+
=AVERAGEIF(A1:A26,"A",B1:B26)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Georgeb123" wrote in message
...
Column A is Funding Source: "A" or "T"
Column B is Days of Stay calculated from check-out date minus check-in
date.
How to calculate Column C as Average Length of Stay for "A"s?




All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com