IRS example: 120 days in each year
Publication 519 and the IRS substantial presence page use 120 days in each of three consecutive years. Count all 120 current-year days, one third of the first prior year's 120 days, or 40, and one sixth of the second prior year's 120 days, or 20. The exact weighted total is 180 days.
The current-year gate is met because 120 is at least 31, while the weighted gate is not met because 180 is below 183. Roam Window reports the weighted-gate message based on those inputs. The example demonstrates why adding the unweighted annual totals, which would produce 360, is not the formula published by the IRS.
The 31-day gate can control the result
Consider 30 current-year countable days, 365 in the first prior year, and 365 in the second prior year. The exact weighted total is well above 183, but the current-year count remains below 31. The Treasury regulation says the test is not applied for a year when physical presence is fewer than 31 days in that current year.
Changing only the current-year count from 30 to 31 changes that gate. The weighted total also rises by one full day because current-year days carry weight one. This pair of examples shows why the interface displays both gates independently instead of reducing the answer to a single weighted number or a generic positive badge.
Excluded days change the count before the weight
Suppose the physical totals are 40 current-year days, 120 first-prior days, and 120 second-prior days, while 10 current-year days have been independently determined to be excluded. Countable days become 30, 120, and 120. The weighted total is 30 plus 40 plus 20, or 90, and the current-year gate is below 31.
If the same ten excluded days belonged to the first prior year instead, countable days would be 40, 110, and 120. Their weighted contributions would be 40, 36 2/3, and 20, for an exact total of 96 2/3. Placement matters because a current-year day removes one full weighted day while a first-prior day removes one third.
Exact sixths prevent threshold rounding errors
A prior-year count not divisible by three or a second-prior count not divisible by six creates a fractional contribution. Under 26 CFR §301.7701(b)-1(c)(1), those fractional days are not rounded to the nearest whole number. Roam Window represents the full calculation as an integer numerator over six and displays a reduced fraction such as 182 5/6 when needed.
A total of 182 5/6 remains below 183; it cannot be displayed as 183 for the comparison. A total of exactly 183 equals 1,098 sixths and meets the weighted arithmetic gate if the separate current-year gate is also met. These statements describe formula thresholds only. Exclusions, closer connection, green-card status, treaties, and procedural facts remain outside the worked arithmetic.
- 120 / 120 / 120 produces exactly 180 weighted days.
- Thirty current-year days cannot satisfy the separate 31-day gate.
- A fractional total below 183 is never rounded upward.
Official sources
- IRS — Substantial presence test and 120-day example
- IRS — Publication 519, U.S. Tax Guide for Aliens
- eCFR — 26 CFR §301.7701(b)-1 exact fractional-day rule
Sources were checked on . Linked institutions may update their guidance after that date.