I am using this =if(count(K4:BM4)>0,average(K4:BM4),"0") to calculate an average
However I would like the range to exclude cells if they contain "OOO"
Is this possible?
I am using this =if(count(K4:BM4)>0,average(K4:BM4),"0") to calculate an average
However I would like the range to exclude cells if they contain "OOO"
Is this possible?
Try this:
=LET(s,SUMPRODUCT(K4:BM4<>"*OOO*"),IF(s>0,SUMPRODUCT((K4:BM4<>"*OOO*")*(K4:BM4))/s,0))
If that doesn't work, attach a sample workbook.
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
thank you
doesnt work on google sheets - which ideally it needs to as my team need to access the sheet https://docs.google.com/spreadsheets...3tU/edit#gid=0
when i export to excel - the formula works but doesnt calculate correctly
You posted in the wrong place for GoogleSheets and you made no mention of it in the opening post - I am moving the thread.
Your workbook is view only - please allow editing access.
You hadn't even adjusted the ranges in the formula, but it seems you could use this:
=IF(COUNTIF(C2:BE2,"<>OOO")>0,AVERAGEIF(C2:BE2,"<>OOO",C2:BE2),0)
Thank you =IF(COUNTIF(C2:BE2,"<>OOO")>0,AVERAGEIF(C2:BE2,"<>OOO",C2:BE2),0) worked
Glad to have helped.
If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.
Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks