Averageif help

Kkajr

New Member
Joined
Feb 3, 2018
Messages
10
Hi, so im trying to do an averageif based on if the range contains a certain word, here is how I tried it

=AVERAGEIF(D2:D892, "*"&LEFT(D2:D892,(FIND(",",D2:D892,1)-1))&"*", B2:B892)

But the word it picks is the word on the same row in column D, so if i move the cell up to 5 for example, it would pick the word from d5, move it down to 10, d10.

Any help appreciated, ill have a lot more questions in the coming hours
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi, so im trying to do an averageif based on if the range contains a certain word, here is how I tried it

=AVERAGEIF(D2:D892, "*"&LEFT(D2:D892,(FIND(",",D2:D892,1)-1))&"*", B2:B892)

But the word it picks is the word on the same row in column D, so if i move the cell up to 5 for example, it would pick the word from d5, move it down to 10, d10.

Any help appreciated, ill have a lot more questions in the coming hours
You should share some data example too.!
 
Upvote 0
Okay, im really new to excel and the forum, how do you like to see data?
744d10c0c336a88a1dcd8509e392d2ce.png

f99125978ebed1aad446a55e4ef82d89.png
119ceb9f10ca637c8c9a083f7dda4e34.png
b16e6a44bc62985812f94b630b6cf0ae.png
 
Upvote 0
Sorry its a little broke, next time itll look a lot cleaner, The B column is just filled with 1s or 0s, I also didnt include a similar picture (because of the 4 pic limit) but i showed the m column function at m20, and the output was 2/9
 
Upvote 0
Thank you aladin for asking that, now im quickly trying to fix it in a way that makes more sense, but im aware it still wont work, pretty much I want to figure out how likely a person is to survive if they had a sibling who survived
Im writing the averageifs right now, so if baclani had a sibling (g column) I want to find every other baclani in the list and average their B which is survival rate, of either a 0 or a 1. My issue arises when looking up the name because it looks up all names
77316e0b6e22105bc52f3cc3a0effd75.png
 
Upvote 0
=AVERAGEIFS(B2:B892, D2:D892, "*"&LEFT(D2:D892,(FIND(",",D2:D892,1)-1))&"*", G2:G892, "=1")

So this works okay, but It only calculates the average chance of survival of a person based on people with the same last name, in 1 row. I want the total average of all the averages of all the rows of people who might be siblings. Also im working on a small fix because my condition includes anyone who has that name, not just last name.
 
Upvote 0
You are not answering the question poste in #6 .

"*"&LEFT(D2:D892,(FIND(",",D2:D892,1)-1))&"*" means everybody listed in
D2:D892
, not a single individual or subset of individuals where the subset is smaller than the whole set.

By the way, it's not helpful posting images as it would would be hard to find someone who would retype into Excel what the mage shows in order to help.
 
Upvote 0
Yeah i was meaning to go figure out how to post the code, ill do that in a second here. In answer to #6 , what i meant by D2:d829, was I wanted it to search the name at a given cell, so like when its at d2, itll look at the name in d2, when its at d3, itll look at the name in d3... etc. and look through the full list for each.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top