Solved

# Return value from a column unless that value is null, then return value from another column.

Posted on 2013-01-03
354 Views
This is probably a simple problem but all I need is a formula to return an value from column B unless B is null, then return the value in column A.

Example:

A        B          c
22      20        20 <value to return in C
13      0           0
64     null      64
64     72         72
null   14        14
0
Question by:swjtx99
• 3
• 2
• 2

LVL 50

Assisted Solution

teylyn earned 250 total points
ID: 38742420
Hello,

maybe this, copied down

=if(B1="null",A1,B1)

If your system uses the semicolon as the list separator, try

=if(B1="null";A1;B1)

cheers, teylyn
0

LVL 23

Accepted Solution

Eirman earned 250 total points
ID: 38742436
Use this in column C
=IF(ISBLANK(B1),A1,B1)

The ISBLANK function can be used to check for blank or null values
0

LVL 50

Expert Comment

ID: 38742469
Now the question for clarification:

Does the cell contain the text "null" or is the cell blank?
0

LVL 23

Expert Comment

ID: 38742492
Hi teylyn, I very much doubt that the word 'null' is really there.

I'm fairly sure swjtx99 wants the word null to represent a blank cell
0

Author Comment

ID: 38742531
Hi,

You are correct Eirman, it's just a blank cell. I specifically go in and do a "clear contents" so I'm sure there is nothing in that cell. My understanding was that would give you a "null" value?

As there was that point of mis-clarity would it be fair to split the points?

Thank you both,

I appreciate the help!

swjtx99
0

Author Closing Comment

ID: 38742532
Grateful to get the help!
0

LVL 23

Expert Comment

ID: 38743313
Thanks swjtx99.
There are subtle (and confusing) differences between null and blank as this post illustrates ....

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_20978027.html
0

## Featured Post

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…