문제

IFERROR((SUMIFS('Sheet 1'!$K:$K,'Sheet 1'!$A:$A,'Sheet 2'!I$5,'Sheet 1'!$C:$C,'Sheet 2'!$B15,'Sheet 1'!$K:$K,"<>0"))/(SUMIFS('Sheet 1'!$J:$J,'Sheet 1'!$A:$A,'Sheet 2'!I$5,'Sheet 1'!$C:$C,'Sheet 2'!$B15,'Sheet 1'!$K:$K,"<>0")),"")
.

Excel에서 다음 기능을 사용하여 작업하고 MS SQL로 해석해야합니다.나는 SQL에 익숙하지만 Excel에 익숙하지 않습니다.내가 이해하는 것에서이 기능이 ""오류가있는 경우 ""를 반환하는 것입니다.그렇지 않으면 가장 안쪽 괄호로 Sumif를 호출합니다. 내부는 무엇을 찾고 있는지 모르겠습니다.

도움이 되었습니까?

해결책

SUMIFS()는 셀의 범위에 적용되는 하나 이상의 기준에 따라 셀의 범위를 추가합니다.

첫 번째는 요약 할 값의 범위이며, 그 후에는 기준 쌍의 쌍을 처음으로 기준 범위, 그 다음 기준입니다.첫 번째 사람은 다음과 같이 끊어집니다 :

    SUMIFS('Sheet 1'!$K:$K   -- Sum this field
            ,'Sheet 1'!$A:$A,'Sheet 2'!I$5  --When same row in A matches Sheet 2 I5
            ,'Sheet 1'!$C:$C,'Sheet 2'!$B15 --When same row in C matches Sheet 2 B, but 15 rows down.
            ,'Sheet 1'!$K:$K,"<>0")  --When the values aren't 0
.

해당 수식의 분자입니다. 2 차 수미 ()를 유사하게 해제 할 수 있습니다.

다른 팁

괜찮 었습니다. 당신이 시트가 무엇인지 전혀 알지 못하면서 SQL을 도울 수는 없지만 당신을 위해 기능을 해결하고 해제 할 것입니다

#this part is for if the enclosed returns an error like #VALUE
#you can think of this as a try rescue block of sorts
#so if there is an Error then Return ""
IFERROR(
  (
   #This part is Summing All the values in Column K for multiple criteria
   #Sum all the values in Column K ref ['Sheet 1'!$K:$K]
   #Where all the values in Column A  = Value in Cell I5 ref['Sheet 1'!$A:$A,'Sheet 2'!I$5]
   #And Values in Column C = Value in Cell B15 ref [ 'Sheet 1'!$C:$C,'Sheet 2'!$B15]
   #And the Values in Column K Do not = 0 ref ['Sheet 1'!$K:$K,"<>0"]
   SUMIFS('Sheet 1'!$K:$K,'Sheet 1'!$A:$A,'Sheet 2'!I$5,'Sheet 1'!$C:$C,'Sheet 2'!$B15,'Sheet 1'!$K:$K,"<>0")
  #Above Number Divided By 
  )/(
   #This part is Summing All the values in Column J for multiple criteria
   #Sum all the values in Column J ref ['Sheet 1'!$J:$J]
   #Where all the values in Column A  = Value in Cell I5 ref['Sheet 1'!$A:$A,'Sheet 2'!I$5]
   #And Values in Column C = Value in Cell B15 ref [ 'Sheet 1'!$C:$C,'Sheet 2'!$B15]
   #And the Values in Column K Do not = 0 ref ['Sheet 1'!$K:$K,"<>0"]
  SUMIFS('Sheet 1'!$J:$J,'Sheet 1'!$A:$A,'Sheet 2'!I$5,'Sheet 1'!$C:$C,'Sheet 2'!$B15,'Sheet 1'!$K:$K,"<>0")
  )
,"")
.

다음은 Sumifs ...에빠른 시놉시스 :

*First Argument is the Rows being Summed
*Second Argument is the Criteria Being Evaulated
*Third Argument is the Expression Being Evaluated Against
*Repeat Second and Third for all additional Criterium
.

해킹 된 SQL

SELECT Sum(Sheet1.ColumnK) / Sum(Sheet2.ColumnJ)
FROM Sheet1 JOIN Sheet2 
WHERE
Sheet1.ColumnA = 10 --I Used 10 in place of Sheet2.ColumnI Row5 as this does not translate directly in SQL
AND Sheet1.ColumnC = 20 -- Same As Above Substitution for Sheet2.ColumnB Row 15
AND Sheet1.ColumnK <> 0
.

희망이 도움이

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top