Excel SUM thiab OFFSET Formula

Cov txheej txheem:

Excel SUM thiab OFFSET Formula
Excel SUM thiab OFFSET Formula
Anonim

Yog tias koj daim ntawv ua haujlwm Excel suav nrog cov lej suav raws li kev hloov pauv ntawm cov hlwb, siv SUM thiab OFFSET ua haujlwm ua ke hauv SUM OFFSET cov qauv kom yooj yim rau txoj haujlwm ntawm kev khaws cov lej mus txog hnub tim.

Cov lus qhia hauv kab lus no siv rau Excel rau Microsoft 365, Excel 2019, Excel 2016, Excel 2013, thiab Excel 2010.

Tsim qhov Dynamic Range Nrog SUM thiab OFFSET Functions

Yog tias koj siv kev suav rau ib lub sijhawm uas pheej hloov pauv - xws li kev txiav txim siab muag rau lub hli - siv OFFSET muaj nuj nqi hauv Excel los teeb tsa qhov kev hloov pauv hloov pauv raws li txhua hnub cov lej muag tau ntxiv.

Los ntawm nws tus kheej, SUM muaj nuj nqi feem ntau tuaj yeem ua kom haum rau kev nkag ntawm cov hlwb tshiab ntawm cov ntaub ntawv rau hauv qhov ntau tau ua tiav. Ib qho tshwj xeeb tshwm sim thaum cov ntaub ntawv tau muab tso rau hauv lub xov tooj ntawm tes qhov chaw ua haujlwm tam sim no.

Hauv qhov piv txwv hauv qab no, cov ntaub ntawv muag khoom tshiab rau txhua hnub tau ntxiv rau hauv qab ntawm daim ntawv teev npe, yuam kom tag nrho txuas mus ntxiv ib lub xov tooj txhua zaus raws li cov ntaub ntawv tshiab ntxiv.

Txhawm rau ua raws li cov lus qhia no, qhib ib daim ntawv ua haujlwm Excel dawb thiab nkag mus rau cov qauv ntaub ntawv. Koj daim ntawv ua haujlwm tsis tas yuav tsum tau formatted zoo li qhov piv txwv, tab sis nco ntsoov sau cov ntaub ntawv hauv tib lub hlwb.

Image
Image

Yog tias tsuas yog SUM muaj nuj nqi tsuas yog siv rau tag nrho cov ntaub ntawv, qhov ntau ntawm cov hlwb siv raws li qhov kev sib cav yuav tsum tau hloov kho txhua zaus ntxiv cov ntaub ntawv tshiab.

Los ntawm kev siv SUM thiab OFFSET ua haujlwm ua ke, qhov ntau yam uas suav tag nrho dhau los ua dynamic thiab hloov pauv kom haum rau cov ntaub ntawv tshiab. Qhov sib ntxiv ntawm cov cell tshiab ntawm cov ntaub ntawv tsis ua teeb meem vim qhov ntau ntxiv hloov kho raws li txhua lub xov tooj tshiab ntxiv.

Syntax and Arguments

Hauv cov qauv no, SUM muaj nuj nqi yog siv los ua kom tag nrho cov ntaub ntawv muab los ntawm kev sib cav. Qhov pib taw tes rau qhov ntau yam no yog qhov zoo li qub thiab raug txheeb xyuas raws li kev siv ntawm tes rau thawj tus lej kom suav tag nrho los ntawm cov qauv.

Lub OFFSET muaj nuj nqi yog nested hauv SUM muaj nuj nqi thiab tsim ib tug dynamic endpoint rau ntau yam ntawm cov ntaub ntawv tag nrho los ntawm cov qauv. Qhov no ua tiav los ntawm kev teeb tsa qhov kawg ntawm qhov ntau mus rau ib lub xovtooj saum toj ntawm qhov chaw ntawm tus qauv.

Tus qauv syntax yog:

=SUM(Range Start:OFFSET(Reference, Rows, Cols))

Cov lus sib cav yog:

  • Range Start: Qhov pib taw tes rau qhov ntau ntawm cov hlwb uas yuav suav tag nrho los ntawm SUM muaj nuj nqi. Hauv qhov piv txwv no, qhov chaw pib yog cell B2.
  • Reference: Qhov xav tau ntawm tes siv los xam qhov kawg ntawm qhov kawg. Hauv qhov piv txwv, Cov Lus Qhia Kev Sib Tham yog lub xov tooj siv rau cov qauv vim tias qhov ntau xaus ib lub xov tooj saum toj no tus qauv.
  • Rows: Tus naj npawb ntawm kab saum toj lossis hauv qab Cov Lus Qhia siv siv los suav cov offset yog xav tau. Tus nqi no tuaj yeem yog qhov zoo, tsis zoo, lossis teeb tsa rau xoom. Yog hais tias qhov chaw offset yog siab dua qhov kev sib cav, tus nqi yog qhov tsis zoo. Yog tias qhov offset yog hauv qab no, Rows sib cav yog qhov zoo. Yog tias qhov offset nyob hauv tib kab, qhov kev sib cav yog xoom. Hauv qhov piv txwv no, qhov offset pib ib kab saum toj saud qhov kev sib cav, yog li tus nqi rau qhov kev sib cav yog qhov tsis zoo (-1).
  • Cols: Tus naj npawb ntawm kab mus rau sab laug lossis sab xis ntawm Cov Lus Qhia Siv tau siv los suav cov offset. Tus nqi no tuaj yeem yog qhov zoo, tsis zoo, lossis teeb tsa rau xoom. Yog hais tias qhov chaw offset nyob rau sab laug ntawm Kev Sib Tham, qhov no tus nqi yog qhov tsis zoo. Yog tias qhov offset yog txoj cai, Cols sib cav yog qhov zoo. Hauv qhov piv txwv no, cov ntaub ntawv tau suav tag nrho yog nyob rau hauv tib kem raws li cov qauv, yog li tus nqi rau qhov kev sib cav no yog xoom.

Siv cov qauv SUM OFFSET rau tag nrho cov ntaub ntawv muag

Qhov piv txwv no siv cov qauv SUM OFFSET rov qab tag nrho rau cov khoom muag txhua hnub uas teev nyob rau hauv kab B ntawm daim ntawv ua haujlwm. Thaum pib, cov mis tau nkag mus rau hauv cell B6 thiab suav tag nrho cov ntaub ntawv muag rau plaub hnub.

Cov kauj ruam tom ntej yog txav SUM OFFSET formula down ib kab los ua chaw rau hnub thib tsib qhov muag tag nrho. Qhov no ua tiav los ntawm kev ntxig ib kab tshiab 6, uas txav cov qauv mus rau kab 7.

Raws li qhov tshwm sim ntawm qhov kev txav mus los, Excel tau hloov kho cov lus sib cav rau ntawm tes B7 thiab ntxiv cell B6 rau qhov ntau yam suav nrog cov qauv.

  1. Xaiv xovtooj B6, uas yog qhov chaw uas cov qauv tshwm sim yuav pib tshwm.
  2. Xaiv tus Formulas tab ntawm lub ribbon.

    Image
    Image
  3. Choose Math & Trig.

    Image
    Image
  4. Select SUM.

    Image
    Image
  5. In the Function Arguments dialog box, tso tus cursor rau hauv Number1 text box.
  6. Hauv daim ntawv ua haujlwm, xaiv lub xovtooj B2 txhawm rau nkag mus rau lub xovtooj ntawm no hauv lub dialog box. Qhov chaw no yog qhov kawg zoo li qub rau cov qauv.

    Image
    Image
  7. In the Function Arguments dialog box, tso tus cursor rau hauv Number2 text box.
  8. Enter OFFSET(B6, -1, 0). Qhov kev ua haujlwm OFFSET no ua rau qhov kawg ntawm qhov kawg rau cov qauv.

    Image
    Image
  9. Xaiv OK kom ua tiav txoj haujlwm thiab kaw lub thawv sib tham. Tag nrho tshwm sim hauv cell B6.

    Image
    Image

Ntxiv Hnub Tom Ntej Cov Ntaub Ntawv Muag

Ntxiv rau hnub tom ntej cov ntaub ntawv muag:

  1. Right-click the row header for kab 6.
  2. Xaiv Insert txhawm rau ntxig ib kab tshiab rau hauv daim ntawv ua haujlwm. Cov qauv SUM OFFSET txav ib kab mus rau ntawm tes B7 thiab kab 6 tam sim no khoob.

    Image
    Image
  3. Xaiv xovtooj A6 thiab sau tus lej 5 txhawm rau qhia tias kev muag tag nrho rau hnub thib tsib tau nkag mus.
  4. Select cell B6, nkag mus $1458.25, ces nias Enter.

    Image
    Image
  5. Cell B7 hloov tshiab rau tag nrho tshiab ntawm $7137.40.

Thaum koj xaiv cell B7, cov qauv hloov kho tshiab tshwm hauv cov qauv bar.

=SUM(B2:OFFSET(B7, -1, 0))

Lub OFFSET muaj nuj nqi muaj ob qhov kev xaiv xaiv: Qhov siab thiab dav, uas tsis tau siv hauv qhov piv txwv no. Cov lus sib cav no qhia rau OFFSET ua haujlwm cov duab ntawm cov zis nyob rau hauv cov nqe lus ntawm cov kab thiab kab.

Los ntawm kev tshem tawm cov lus sib cav no, txoj haujlwm siv qhov siab thiab qhov dav ntawm Cov Kev Sib Tham Hloov Kho, uas, hauv qhov piv txwv no yog ib kab siab thiab ib kab dav.

Pom zoo: