How do you perform a calculation based on status entry?

alm395

New Member
Joined
Apr 23, 2018
Messages
39
Office Version
  1. 365
Platform
  1. Windows
Hi!

I am trying to set up an invoice tracker that captures credits, amounts due, payments, and the account balance once any of those fields have been captured. Currently, I have a calculation that I manually update in the remaining balance column depending on the type of transaction. This is the current formula I am using (see sample workbook):

=IFS([@STATUS]="INVOICED",K8-[@[AMOUNT DUE]],[@STATUS]="PAID",K8-[@[AMOUNT PAID]],[@STATUS]="CREDIT MEMO",[@[AMOUNT CREDITED]]+K8)

I was able to get this calculation to work, but I don't know how to make it calculate for the matching Status line items ("Invoiced" line 10 should subtract from the previous "Invoiced" Balance Remaining, not from "Paid" line 9). I hope that makes sense...

Thank you!
ALE


Book2
ABCDEFGHIJKLMNOP
1
21234 - PO TRACKERPAYMENT OVERVIEWPO BALANCEAMOUNT INVOICEDAMOUNT PAIDAMOUNT QUOTEDREMAINING BALANCE
3PO: 12345678(10/30/2020 - 10/29/2023)$ 232,950.00$ 143,000.00$ 143,000.00$ -$ 89,950.00
4
5PO # / CHECK #P.O. DATE / POSTING DATEINVOICE #INVOICE DATEDESCRIPTIONDATE DUEAMOUNT CREDITEDAMOUNT DUEAMOUNT PAIDREMAINING BALANCEPAYMENT DATE COMMENTS STATUSSTATUS
6123412/03/2020OPENING BALANCE$ 232,950.00$ -$ -$ 232,950.00-TRAININGOPENING BALANCEINVOICED
7--112501911/05/2020WORK REQUEST 112/05/2020$ -$ 10,000.00$ -$ 222,950.00-(11/05/20 - 11/04/21)INVOICEDPAID
8--112502211/05/2020WORK REQUEST 212/05/2020$ -$ 41,250.00$ -$ 181,700.00-INVOICEDOVERDUE NOTICE
958843812/03/2020--PAYMENT FOR INV 1125019 + 1125022-$ -$ -$ 51,250.00$ 130,450.0012/08/2020PAIDCREDIT MEMO
10--54401A11/16/2021WORK REQUEST 312/16/2021$ -$ 10,000.00$ -$ 120,450.00-(11/09/21 - 11/08/22)INVOICEDQUOTE
11--54401C11/16/2021WORK REQUEST 412/16/2021$ -$ 41,250.00$ -$ 79,200.00-(11/09/21 - 11/08/22)INVOICEDOPENING BALANCE
12--5449311/17/2021WORK REQUEST 512/17/2021 a $ 2,500.00$ -$ 76,700.00-(11/09/21 - 01/08/22)INVOICED
1360126001/26/2022--PAYMENT FOR INV 54401A + 54401C + 54493-$ -$ -$ 53,750.00$ 22,950.0001/27/2022PAID
14--6261005/18/2022WORK REQUEST 606/17/2022$ -$ 24,000.00$ -$ (1,050.00)-(5/3-5/5 & 5/10-5/12)INVOICED
1560496105/26/2022--PAYMENT FOR INV 62610-$ -$ -$ 24,000.00$ (25,050.00)05/26/2022PAID
16--6758008/26/2022WORK REQUEST 709/24/2022$ -$ 8,000.00$ (33,050.00)-(08/09/2022 - 08/08/2023)INVOICED
1760828508/25/2022--PAYMENT FOR INV 67580-$ -$ -$ 8,000.00$ (41,050.00)08/30/2022PAID
186897509/26/2022WORK REQUEST 810/26/2022$ -$ 6,000.00$ -$ (47,050.00)(09/22/2022 - 09/21/2023)INVOICED
19--PAYMENT FOR IN 68975-$ -$ -$ 6,000.00$ (53,050.00)PAID
2009/01/2022CREDIT FOR OVERPAY$ 1,000.00$ -$ -$ (52,050.00)CREDIT MEMO
21$ -$ -$ -$ -
Sheet1
Cell Formulas
RangeFormula
H3H3=$H$6
I3I3=SUMIF(Table13[STATUS],"<>QUOTE",Table13[AMOUNT DUE])
J3J3=SUM(Table13[AMOUNT PAID])
K3K3=SUMIF(Table13[STATUS],"QUOTE",Table13[AMOUNT DUE])
L3L3=$H$6-SUM(Table13[AMOUNT PAID])
K6,K21K6=[@[AMOUNT CREDITED]]-[@[AMOUNT DUE]]
K7:K20K7=IFS([@STATUS]="INVOICED",K6-[@[AMOUNT DUE]],[@STATUS]="PAID",K6-[@[AMOUNT PAID]],[@STATUS]="CREDIT MEMO",[@[AMOUNT CREDITED]]+K6)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B6:N21Expression=$N6 = "CREDIT MEMO"textNO
B6:N21Expression=$N6="INVOICED"textNO
B6:N21Expression=$N6="PAID"textNO
B6:N21Expression=$N6="OVERDUE NOTICE"textNO
B6:N21Expression=$N6="QUOTE"textNO
Cells with Data Validation
CellAllowCriteria
N6:N21List=$P$6:$P$12
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
If I understand correctly, you will probably want to split the summation into two parts, with each part determining which cell to use. The first IFS statement checks whether STATUS is empty or contains "INVOICED" or something else...and returns the appropriate cell. The second IFS statement is very much like your original one with the "K" cell references removed. This second IFS statements also needs to check whether STATUS is empty (and return a 0) to avoid producing an error in the last row. Try this in K7 and down:
Excel Formula:
=IFS([@STATUS]="",0,[@STATUS]="INVOICED",IFERROR(LOOKUP(2,1/(N$6:N6="INVOICED"),K$6:K6),K6),[@STATUS]<>"INVOICED",K6)  +  IFS([@STATUS]="INVOICED",-[@[AMOUNT DUE]],[@STATUS]="PAID",-[@[AMOUNT PAID]],[@STATUS]="CREDIT MEMO",[@[AMOUNT CREDITED]],[@STATUS]="",0)
Which version of Excel are you using? Update your profile to display that...as there are other options if you have Excel 365 functions.
 
Upvote 0
Carefully check the CREDIT MEMO line...I"m not sure which cell is supposed to be used for the sum (the cell immediately above, or the last INVOICED row?).
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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