This version will move left a column if the value is either NA or 0:
=IF(OR(ISNA(D2),D2=0),IF(O
Kevin
Main Topics
Browse All TopicsI have three cost columns (B - D) and I want to pick the rightmost column when appropriate. I have formulas in Columns C and D which sometimes return '#N/A'. If the value in Column D, Cost 3, is '#N/A' I want the formula to move to the left and evaluate that column for a number. If the value in Column C, Cost 2, is '#N/A' I want the formula to move to the left and choose the number in Column B, Cost 1. Column B will will never have formulas but is the least preferred number. I've tried both of the following formulas in Column E, Final Cost, but neither works completely right.
=IF(ISNA(D2) <> "TRUE",D2,IF(ISNA(C2),B2,C
=IF(D2 > 0,D2,IF(ISNA(C2),B2,C2))
A B C D E
1 Item Cost 1 Cost 2 Cost 3 Final
2 88005947 1.0000 #N/A #N/A #N/A
3 88005954 - 2.0000 0 2
4 88006002 - 3.0000 1 1
Thanks,
George
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi dssxpert,
You can use the LOOKUP function to get the rightmost value. It will exclude #N/A error values and blanks.
=LOOKUP(1E+40,B2:D2) if the value is a number
=LOOKUP("zzzzz",B2:D2) if the value is text
The first parameter in the LOOKUP formulas are intended to be larger than any possible data you might have in columns B through D. 1E+40 (10^40) is an extremely large number; only a physicist, astronomer or mathematician is apt to need anything larger. Likewise, the text string "zzzzz" will sort last in almost any alphabetized list.
Hoping to be helpful,
Brad
George,
Here is a sample workbook showing how the LOOKUP formula might work. http://www.ee-stuff.com/Ex
If you have text that looks like numbers, then here is a revised formula that will still find the last "number" in the row:
=LOOKUP(1E+40,--B2:D2)
The unary operator (looks like -- ) forces the conversion of the data into real numbers.
Brad
George,
And if the formula needs to skip over 0 values, then try the array formula:
=LOOKUP(1E+40,IF(B2:D2=0,"
Array formulas need to be entered in a special way: hold the Control and Shift keys down, then press Enter. Excel should respond by adding curly braces { } surrounding the formula. If it doesn't, then select the cell, click in the formula bar and CTRL + Shift + Enter.
Brad
Revised file showing the formula that ignores zero values http://www.ee-stuff.com/Ex
=LOOKUP(1E+40,IF(B2:D2=0,"
Solutions from both authors worked, but neither worked 100%--I believe this is because the #N/A's that I have are caused by lookups to a separate workbook. The example I constructed for my question was an extremely simplified version of my real table. The final array formula choked less on the #N/A's and that's why I awarded it more points. I thank both authors for their time and efforts, this was an extremely frustrating problem to resolve at work.
George
Business Accounts
Answer for Membership
by: zorvekPosted on 2006-05-22 at 17:28:42ID: 16738958
=IF(ISNA(D2),IF(ISNA(C2),B 2,C2),D2)
Kevin