简体   繁体   中英

IF formula - EXCEL - obtain data from another cell

I am calculating the approximate cost per journey of our metro and country customers.

I need to know how to get cells H4:H42 to obtain the data from cell D43 which says "Metro driving" if the value is 1 OR the data from D45 which says "Country driving" if the value is 2.

Hope this makes sense.

Thanks in advance.

Are u lookin below one ?(place this formula in D4 cell)

Assuming that D43 = "Metro driving", and D45 = "Country driving", you could use the following:

=IF(H4=1,$D$43,IF(H4=2,$D$45,"Nothing Matched"))

You could try a simple find and replace or the following formula:

=CHOOSE($H4,$D$43,$D$45)

This gets the value in H and assigns D43 for 1, D45 for 2, and so on if you were to add more values for 3+.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM