0
I'm trying to sort out dyadic data using Excel. I have information on wars, sort of like this:
Conflict | Country | Government | Side | repdyads | mondyads |
Spanish-American War | Spain | monarchy | 1 |
Spanish-American War | USA | republic | 2 |
World War II | Britain | monarchy | 1 |
World War II | France | republic | 1 |
World War II | Poland | republic | 1 |
World War II | Germany | fascist | 2 |
World War II | Italy | monarchy | 2 |
What I'd like to do is create a COUNTIF statement which tells me how often countries of the same 'type' were on opposite sides of a war - so for the above example, return 0 in all columns for the Spanish-American war, because Spain and the US were different types, but return 1 in the monarchy column for World War II because of Britain and Italy (obviously, my real data looks a bit different). I've tried something like this:
=IF(COUNTIF(C3:C8,"monarchy")>0,1)
My problem is that because the wars have different numbers of participants, I can't figure out how to make a single formula which will work for everything. Is it possible to use a VLOOKUP or INDEX formula to specify the range as being everywhere where the A column is consistent with the first line?
Thank you all! Learning excel has been a pain but a lot of fun.
EDIT: expanded above example. Ideal result would be something like this:
Conflict | Country | Government | Side | repdyads | mondyads | repmondy |
Spanish-American War | Spain | monarchy | 1 | 0 | 0 | 1 |
Spanish-American War | USA | republic | 2 | | | |
World War I | Britain | monarchy | 1 | 0 | 1 | 1 |
World War I | France | republic | 1 | | | |
World War I | Russia | monarchy | 1 | | | |
World War I | Germany | monarchy | 2 | | | |
World War I | Austria| monarchy | 2 | | | |
World War I | Bulgaria| monarchy | 2 | | | |
World War II | Britain | monarchy | 1 | 1 | 0 | 1 |
World War II | France | republic | 1 | | | |
World War II | Poland | republic | 1 | | | |
World War II | Germany | fascist | 2 | | | |
World War II | Italy | monarchy | 2 | | | |
So this tells me that in the Spanish-American war, republics fought monarchies. In WWI, Monarchies fought monarchies and republics fought monarchies, but republics did not fight other republics. The number of dyads is not important, rather who is fighting who.
You mean for each war and each type you want to use countif? – yass – 2017-04-22T19:18:03.410
Add a table to the question that shows an example of the counts you want to get when you do it manually, and the logic you used to do it. – fixer1234 – 2017-04-22T20:43:38.277
For each potential dyad there'd be a column on the right. The number of participants isn't important, just what crossovers exist. – TacticalStrategy – 2017-04-22T21:19:04.470