Say I have 20 cells all with different number values plus and minus, is there a way I can select all of them and have a formula highlights which highlights which of these values when added/deducted equals zero?
Say I have 20 cells all with different number values plus and minus, is there a way I can select all of them and have a formula highlights which highlights which of these values when added/deducted equals zero?
I doubt you could do this with a formula, you could have your 20 cells in A1:A20, then in B1:B20 put:
=RANDBETWEEN(0,2)
and in A21 put:
=SUM(IF(B1:B20=1,A1:A20,IF(B1:B20=2,-A1:A20,0)))
as an array formula (confirm with ctrl+shift+enter)
then run this macro:
This would find you one solution by trial and error, set your maximum iterations (20000 in my code) as neccessary. I'm not sure what you want to happen if there are several solutions...Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks