简体   繁体   中英

Array formula sum column

Any one can help me, I have thousand column need formula to count.

   A         B       C          B
1,000.00    50.00   0.00      100    
1,000.00    -       50.00     100 
1,000.00    50.00     - 
1,000.00    -       25.00     50 

Any body know how to array this formula

=ifs(or(D2="-",D2=""),"",C2<>"-",D2+A2-C2,C2="-",D2+A2-B2)

Sample spreadsheet here

For an array formula, you need to pass an array of cells. For example, rather than D2 , use D2:D .

The OR() statement will cause issues, so you need to reformat it using bracket notation to create a new range for the single condition field and + for the OR.

=ARRAYFORMULA(IFS({(D2:D="-")+(D2:D="")},"",C2:C<>"-",D2:D+A2:A-C2:C,C2:C="-",D2:D+A2:A-B2:B))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM