Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculating an average | Excel Worksheet Functions | |||
Calculating an average using VBA | Excel Programming | |||
Calculating the average | Excel Discussion (Misc queries) | |||
Calculating an average based on 2 and 3 criteria | Excel Worksheet Functions | |||
calculating an average based on criteria | Excel Programming |