Google Sheets – Cell-Dependent Ranges in Data Validation

google sheets

Regarding Google Sheets — is there any way to have cell-ranges in data validation depend on the cell itself. For instance, I want G7 to accept input only from E7 and F7. Similarly, I want G8 to accept input only from E8 and F8. But if I copy and paste the data validation from G7 to G8, G8 will incorrectly accept input from E7 and F7 rather than E8 and F8. Sure, I can just do G8 manually, but if I want to be able to do this a thousand times, it's not exactly feasible!

One potential solution that occurred to me would be to include the ROW function in the data validation, but I think I would need to use a custom formula for that and I can't come up with a custom formula that outputs a range. I'd appreciate any advice!

BTW – the motivation for this is to create a Google Sheet implementation of a March Madness bracket where the prices (or payoffs) are endogenous, i.e. determined by people's selections. The Google sheet has a lot of neat features to do it, particularly because everybody can access it online and I can give people editing privileges to just their row of entries. I'll link the bracket here if/when I ever get it up and running!

UPDATE – it turns out you can do this easily in Excel as you can use the $ sign in the data validation just as you can in a formula so that when you copy and paste it updates anything that isn't fixed by $. Google Sheets ignores a $ sign if you put it into the data validation range because and just fixes it either way.

Best Answer

A Custom formula is as a validation rule of:

 =or(G1=offset(G1,0,-2),G1=offset(G1,0,-1))

applied to the whole of ColumnG should work on the 'row by row' basis I think you require.

OR
OFFSET