더미 변수가있는 Excel 목록이 있습니다. 백분율을 자동으로 계산하여 새 행에 추가하려면 어떻게합니까?


0

이것은 내 데이터입니다.

Company             Year    Name            Position Gender Sales
                                                    (0=Male)
Johnson & Johnson   2016    Alex Gorsky     Director    0   71891000
Johnson & Johnson   2016    M. C. Beckerle  Director    1   71891000
Johnson & Johnson   2016    D. S. Davis     Director    0   71891000
Johnson & Johnson   2016    I. E. L. Davis  Director    0   71891000
Johnson & Johnson   2016    M. B. McClellan Director    0   71891000
Johnson & Johnson   2016    A. M. Mulcahy   Director    1   71891000
Johnson & Johnson   2016    W. D. Perez     Director    0   71891000
Johnson & Johnson   2016    C. Prince       Director    0   71891000
Johnson & Johnson   2016    A. E. WashingtonDirector    0   71891000
Johnson & Johnson   2016    R. A. Williams  Director    0   71891000
Johnson & Johnson   2015    Alex Gorsky     Director    0   70079000
Johnson & Johnson   2015    M. C. Beckerle  Director    1   70079000
Johnson & Johnson   2015    D. S. Davis     Director    0   70079000
Johnson & Johnson   2015    I. E. L. Davis  Director    0   70079000
Johnson & Johnson   2015    M. B. McClellan Director    0   70079000
Johnson & Johnson   2015    A. M. Mulcahy   Director    1   70079000
Johnson & Johnson   2015    W. D. Perez     Director    0   70079000
Johnson & Johnson   2015    C. Prince       Director    0   70079000
Johnson & Johnson   2015    A. E. WashingtonDirector    0   70079000
Johnson & Johnson   2015    R. A. Williams  Director    0   70079000
Johnson & Johnson   2015    M. S. Coleman   Director    1   70079000
Johnson & Johnson   2015    S. L. Lindquist Director    1   70079000
Johnson & Johnson   2014    Alex Gorsky     Director    0   74336000
Johnson & Johnson   2014    D. S. Davis     Director    0   74336000
Johnson & Johnson   2014    I. E. L. Davis  Director    0   74336000
Johnson & Johnson   2014    M. B. McClellan Director    0   74336000
Johnson & Johnson   2014    A. M. Mulcahy   Director    1   74336000
Johnson & Johnson   2014    W. D. Perez     Director    0   74336000
Johnson & Johnson   2014    C. Prince       Director    0   74336000
Johnson & Johnson   2014    A. E. WashingtonDirector    0   74336000
Johnson & Johnson   2014    R. A. Williams  Director    0   74336000
Johnson & Johnson   2014    M. S. Coleman   Director    1   74336000
Johnson & Johnson   2014    S. L. Lindquist Director    1   74336000
Johnson & Johnson   2014    J.G. Cullen     Director    0   74336000
Johnson & Johnson   2014    L.F. Mullin     Director    0   74336000

그 목록은 꽤 오랫동안 계속됩니다.

남성과 여성의 비율을 새 행에 백분율 (예 : 0.2)로 지정해야합니다. 매년 별도로 계산됩니다.

프로그래밍 지식이 있지만, 어디서 어떻게 시작 해야할지 무력합니다.


귀하의 회사가 공개적으로 공유하는 것을 원치 않는 경우가 아니면 귀하의 실제 데이터가 아니기 바랍니다.
— Vylix

실제 데이터이지만 EDGAR를 통해 공개적으로 사용 가능합니다.
— of_horse

무엇의 비율? 남성 비율?
— Kevin Anthony Oppegaard Rose

예, 비록 그것이 중요하지 않더라도 여성이나 남성. 이상적으로는 2016 년에 2/10 또는 0.2와 같은 골절이 될 수 있습니다. Excel 자체로 달성 할 수 있습니까, 아니면 vba에 들어갈 필요가 있습니까?
— of_horse

좋습니다. 그렇기 때문에 각 연도의 남성 비율을 분수로 표시해야합니다. Excel에서는 비교적 쉽습니다. 나는 대답을 게시 할 것이다.
— Kevin Anthony Oppegaard Rose

답변:


0

피봇 테이블로도 계산할 수 있습니다.

귀하의 성별은 이미 가치로 주어집니다. 0 과 1 평균을 계산하면 1 에스:

enter image description here


1

도우미 테이블을 만들어야합니다.

이 시도

=IFERROR(COUNTIFS(B:B, E1, A:A, D1)/COUNTIF(A:A, D1), 0)

그런 다음 숫자 형식을로 변경하여 백분율로 변환 할 수 있습니다. 백분율

테이블과 일치하는 연도가없는 경우 (2013 년 데이터를 찾고 있음), 코드를 IFERROR그렇지 않으면 DIV/0 오류.

1 년을 A 과 D 서식이 지정되어있다. 모두 같은 텍스트 또는 숫자 (또는 날짜)로 표시됩니다.

Screenshot


너는 내 앞에있어. :)
— Kevin Anthony Oppegaard Rose

내 경우에는 # DIV / 0 오류가 발생하지만, 몇 년 후에는 여성이 없기 때문에 이것이라고 가정합니다. 나는 공식을 뒤집어 썼다. 그러나 지금까지 어떤 운도 가지지 않고 있었다. 나는 그것을 알아 냈을 때 업데이트를 게시 할 것이다!
— of_horse

@of_horse 아니요. 참조의 연도가 조회 표와 일치하지 않습니다 (2013 년 또는 그 이전 또는 2018 년 이후) 또는 전혀 표시되지 않거나 텍스트 중 하나로 서식을 지정하고 다른 형식으로 다른 형식을 지정합니다 ( 번호).
— Vylix

그것은 텍스트 ... 내 나쁜, 고마워.
— of_horse
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.