Hello, I'm stuck with something I am trying to calculate in a spreadsheet and hoping someone can help.
I want to work out the average of a set of data in column AM. However, I only want to include the cells in AM when the corresponding values in column D and column AN both equal the word "Yes". Please can someone explain how I would write this formula?
I hope this makes sense
Many Thanks
Last edited by milliemoo; 10-25-2011 at 05:36 AM.
Try:
=AVERAGE(IF(($D$2:$D$200="Yes")*($AN$2:$AN$200="Yes"),$AM$2:$AM$200))
Confirmed with Ctrl+Shift+Enter as it's an array formula.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
You can use AVERAGEIFS in Excel 2007
=AVERAGEIFS(AM:AM,AN:AN,"Yes",D:D,"Yes")
Audere est facere
Fantastic....thank you so much for your swoft responses. The AVERAGEIFS fun ction works perfectly!
Apologies as I do not know how to mark this as SOLVED
To mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks