Top
Best
New

Posted by fouronnes3 12/11/2025

Show HN: I made a spreadsheet where formulas also update backwards(victorpoughon.github.io)
Hello HN! I'm happy to release this project today. It's a bidirectional calculator (hence the name bidicalc).

I've been obsessed with the idea of making a spreadsheet where you can update both inputs and outputs, instead of regular spreadsheets where you can only update inputs.

Please let me know what you think! Especially if you find bugs or good example use cases.

252 points | 116 commentspage 2
Animats 12/13/2025|
Somebody did this back in the DOS era. The program was sometimes called "the crooked accountant's spreadsheet", because you could start with the outputs you wanted and get the input numbers adjusted to fit.

Anyone remember?

kccqzy 12/12/2025||
I think the concept is solid. I’ve only had a few minutes of playing with it, but I have the opinion is that from a UX perspective constants are more common than variables. So perhaps a cell containing a constant should not have a #, but a variable should.
satvikpendem 12/13/2025||
Ah, two way data binding. If you've used any frameworks before React (and a couple earlier ones with the same philosophy) you'll understand how it becomes a spaghetti mess over time.
culi 12/13/2025|
Not necessarily if you're following best practices. Modern angular is quite scalable and uses two way data binding
remywang 12/12/2025||
A bidirectional formula is also known as an integrity constraint in databases (plus some triggers for restoring the constraint upon updates)!
penteract 12/14/2025||
This is great.

Since you've asked about bugs, I tried pushing the limits and found the following:

    A1: 100          B1: =100-A1
    A2: =A1*(100-A1)
    A3: =A1*B1
A2 can be successfully set to anything reasonable (up to 2500)

However, setting A3 to exactly 100 doesn't work, even though setting it to 101 or 99 (or even 100.000001) does work.

Another limit:

    A1: 100          B1: 100
    A2: =A1+B1
    A3: =A1*B1
    A4: =abs(A2-100) + abs(A3-100)
Setting A4 to zero (or anything below 80) doesn't work. This doesn't improve if the constants in the A4 formula are moved a short distance away from 100.

In case you can't tell from that last example, I think being able to fix the intended values of multiple outputs simultaneously would be interesting. If you were to give more details about the solver's internals, I'd be keen to hear them.

zkmon 12/13/2025||
The idea is very interesting. As a default strategy you could preserve the ratio of inputs by scaling them to match the scaling of the output, instead of making them equal (for addition). Similarly, for multiplication, you could preserve the ratio of inputs as well, by scaling them by nth root of the scaling factor of the output.
fouronnes3 12/13/2025|
Currently the solver does not use the previous values of inputs at all when solving. But it could use it in some cases as a heuristic I guess, yes!
d--b 12/13/2025||
The examples are great and these bidirectional calculators are something that people would love to have in traditional spreadsheets.

So much so that Credit Suisse, which basically was running everything on heavily modded Excel, created a full language whose outputs were Excel spreadsheets capable of doing that. That thing called “paradise” was a total monstrosity but showed how much people wanted this.

That said, you really need a way to set which cells are fixed and which cells are allowed to move if you want to move past basic examples.

Most times you know what you want to do. like => if the user modifies that cell, find a solution for those specific ones.

If you can enter that info, then you have a lot more constrains for your solver and will avoid a lot of edge cases where everything goes to 0, and you can check that the calculation entered is indeed reversible or not, or if it could have multiple solutions, and so on.

amelius 12/13/2025||
> and these bidirectional calculators are something that people would love to have in traditional spreadsheets

People want them in general programming languages too. I can't count the number of times I had to implement the same function multiple times, but backwards in various ways.

fouronnes3 12/13/2025||
Constants are supported, use # as a prefix, e.g.; #50.

I'd like to add more constraints in the future like a domain constraint for variables.

nico 12/13/2025||
Could you build an inverse kinematics solver with this? (I recently watched a youtube video of someone iteratively working out the solutions for a robotic arm, by alternating modifying the inputs and the results)
fouronnes3 12/13/2025||
That's an interesting example I hadn't thought of. Probably? I'll need to try it. Thank you for the suggestion!

I think one issue will be that trig functions are kinda weird because they are non-injective. So they work but they are awkward (try solving cos(A1) = 0.5). Inverse kinematics is so well studied, you're probably better off using a dedicated algorithm.

amelius 12/13/2025||
Closed form solutions might be more efficient (in time, energy) and perhaps more numerically stable.
rvba 12/26/2025||
Spredsheet but no VLOOKUP?
jy14898 12/13/2025|
you might like https://omrelli.ug/g9/ which is a similar concept but for graphics
fouronnes3 12/13/2025|
I do like g9! It was a strong inspiration for bidicalc actually!
More comments...