Riyaz gave a really good solution. From me I would add one more thing: Based on preformance comparison of the time formulas (previous/next, lag/lead, offset, lookup) for your use case I would recommend to use NEXT() rather than OFFESET(). More you can learn here: Performance Comparison - OFFSET/LAG/PREVIOUS/LOOKUP
The difference in performance in your case is not significant between the either options, but formula looks a bit cleaner this way: Base - Base Input - (NEXT(Base) - NEXT(Base Input))
If you data is a time series and you are using native time dimension then use PREVIOUS and NEXT to reference data from the cell one period before and one period ahead of the target cell.
If your data is not time series and you need to reference data from various sections of another list then you will need to create a mapping table which will inform which item should be reference on each occasion. For this use LOOKUP .