![]() |
Calculating the average value with criteria
Hi group,
I hope someone can figure out a macro to do what I want. The setup is as follows: Cells B1:B5 contain numbers. Sometimes some of the cells may be empty. Cells in the corresponding row, column A, (that include the text "girl" or "boy" or "lady" shall not be represented in the average value I want the average value of B1:B5 to be calculated in cell B6 Excample: B1=2 B2 (empty) B3=4 B4=7 (A4 contains the text "She is a nice girl". Therefore cell B4 shall not be included in the average. B5=9 ______ In this case the calculated value in cell B6=5 ((2+4+9)/3) Regards, Kaj Pedersen --- Denne e-mail blev kontrolleret for virusser af Avast antivirussoftware. https://www.avast.com/antivirus |
Calculating the average value with criteria
Hi Kaj,
Am Sat, 26 Dec 2015 21:31:03 GMT schrieb : B1=2 B2 (empty) B3=4 B4=7 (A4 contains the text "She is a nice girl". Therefore cell B4 shall not be included in the average. B5=9 ______ In this case the calculated value in cell B6=5 ((2+4+9)/3) you can do it with formula: =AVERAGEIFS(B1:B5,A1:A5,"<"&"*girl*",A1:A5,"<"&" *boy*",A1:A5,"<"&"*lady*") Regards Claus B. -- Vista Ultimate / Windows7 Office 2007 Ultimate / 2010 Professional |
Calculating the average value with criteria
Hi Claus,
It works to my full satisfaction and is much easier than a macro. Thank you very much for your help. Best regards, Kaj Pedersen --- Denne e-mail blev kontrolleret for virusser af Avast antivirussoftware. https://www.avast.com/antivirus |
All times are GMT +1. The time now is 08:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com