Condition required for difference

Cenin

New Member
Joined
Jan 30, 2023
Messages
23
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
  9. 2003 or older
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
1675074085415.png

Hi, From this data, I would like to get the difference between columns 42437-42257 in accordance with the Gender Male or Female and show whether it is male or female is higher.
 

Attachments

  • 1675073737472.png
    1675073737472.png
    5.1 KB · Views: 7
  • 1675073822529.png
    1675073822529.png
    5.5 KB · Views: 6
  • 1675074010374.png
    1675074010374.png
    3.4 KB · Views: 7
Thanks for the help sir
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Could you please take a look at this? I am getting error on this..
is it showing an error because it has only one line on the PC for 48, or it has only one gender in the PCs ?
Book1
BCDEF
1GenderPCAverage on PC, Male & Female.DIFF IN EUROSPC HIGHEST GENDER
2M4640560#CALC!#CALC!
3M58143171#CALC!#CALC!
4M58143171#CALC!#CALC!
Sheet3
Cell Formulas
RangeFormula
E2:E4E2=D2-INDEX(FILTER(D$2:D$4,(B$2:B$4=IF(B2="F","M","F"))*(C$2:C$4=C2)),1)
F2:F4F2=IF(E2>0,B2,IF(E2=0,"EQUAL",IF(B2="F","M","F")))
 
Last edited:
Upvote 0
is it showing an error because it has only one line on the PC for 48, or it has only one gender in the PCs ?
In that circumstance, what result do you want to appear in column E since there is no way to calculate an actual 'difference'?
 
Upvote 1
value 0 sir. The genders (if it is M&M, M&F, only M, only F, in a PC, and their values do not have any difference, the column E should produce the result as a 0 value
 
Upvote 0
value 0 sir.
Hmm, that seems a bit odd. IF M =100 and F = 100 then clearly the difference is 0 but if M = 100 and there are no F values, putting 0 seems to me to imply there is no difference between M & F

Anyway, if you do want 0 you can have it, but does that also mean that you want "EQUAL" in the next column?
 
Upvote 1
You're right, but in this case, it would be better to have it as 0 and EQUAL in next column
 
Upvote 0
In that case, try this

23 01 30.xlsm
ABCDEF
1CountGenderPCAverage on PC, Male & Female.Differencewho
22F6042436.930EQUAL
32F6042436.930EQUAL
43F4742436.93180.43F
51M4742256.5-180.43F
63F4742436.93180.43F
73F4742436.93180.43F
Compare (2)
Cell Formulas
RangeFormula
E2:E7E2=D2-INDEX(FILTER(D$2:D$16,(B$2:B$16=IF(B2="F","M","F"))*(C$2:C$16=C2),D2),1)
F2:F7F2=IF(E2>0,B2,IF(E2=0,"EQUAL",IF(B2="F","M","F")))
A2:A7A2=COUNTIFS($C$2:$C$13,C2,$B$2:$B$13,B2)
 
Upvote 1
Solution
Thank you, sir. It works as expected
 
Upvote 0
Hi Sire, one more query
Colum D represents the difference between males and females on PC, and I would like to get the percentage difference of that difference from the highest value of the PC. Could you please help?
France Exec Gender Gap Analysis.xlsx
ABCDE
1GENDERPCAverage on PC, Male & Female.DIFF IN EUROSExpected results
2M591370211850013,50%
3M591370211850013,50%
4F59118521-18500-13,50%
5M591370211850013,50%
6M591370211850013,50%
7M591370211850013,50%
8M591370211850013,50%
9M601393331500110,77%
10F60124333-15001-10,77%
11F60124333-15001-10,77%
12M601393331500110,77%
13F60124333-15001-10,77%
14M601393331500110,77%
Sheet7
 
Upvote 0

Forum statistics

Threads
1,215,135
Messages
6,123,241
Members
449,093
Latest member
Vincent Khandagale

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