Numbers: How can I return the value of a neighbouring cell if current cell equals a certain value?

StackOverflow https://stackoverflow.com/questions/19611953

문제

I'm trying to create a formula that evaluates the current cell value and when this one equals "true" it should take the value of the neighbouring cell.

Example: I'm in cell L33 to calculate the sum. Cell J2 has a dropdown with values "0%", "6%" and "21%". I want cell L33 to check what value has been selected here and if it equals "0%" to take the value of cell K2, else take the value of cell L2 or M2 respectively.

Does anyone know a formula that does this? I'm still kind of a beginner here at Numbers/Excel, but I'm pretty sure it's possible to this within the program.

도움이 되었습니까?

해결책

This could just be done quite simple with nested if-statements. Try something like this:

=IF(J2=0,K2,IF(J2=0.06,L2,IF(J2=0.21,M2)))

This only works if the percentages is formatted as percentages. If they are formatted as a string value you would need to do something like this:

=IF(J2="0%",K2,IF(J2="6%",L2,IF(J2="21%",M2)))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top