Ghost Sheet

Nested IF: several bands in one formula

How do I sort invoices into aging buckets?

This is the task for this topic. It is part of the plan; the level check before it is free.
D2Type a formula for D2, starting with =

Click the sheet or the button: the task opens in your workspace, ready to type

ABCDE
1SupplierInvoiceDays overdueBucket
2Brightline ChemicalsINV-410137
3Fenwick ToolsINV-410259
4Brightline ChemicalsINV-41034
5Marlow PrintINV-410461
6Calder PaperINV-410519
7Fenwick ToolsINV-4106-5
8Calder PaperINV-410729
9Brightline ChemicalsINV-41087
10Tidewater FreightINV-410931
11Calder PaperINV-411049
12Brightline ChemicalsINV-411110
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
dashed: the answer to reachblack: matchesblue: right after new datared: wrong

Why it works

What it does
An IF inside another IF’s “false” part tests the next condition when the first fails. Order the tests from one end of the scale to the other and decide where each boundary value belongs: is day 30 in 1-30 or in 31-60?
The shape of the formula
=IF(test 1, result 1, IF(test 2, result 2, IF(test 3, result 3, otherwise)))
How to remember it
Walk the boundaries: try 0, 30 and 60 in your head before you trust it.
The usual mistake
Using < where the rule says “up to and including”. Invoices exactly on a boundary land one bucket late.

Keep practicing

Updated