Solved

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

Posted on 2013-01-03
7
357 Views
Last Modified: 2013-01-04
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
Comment
Question by:swjtx99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 50

Assisted Solution

by:Ingeborg Hawighorst
Ingeborg Hawighorst 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

by:
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

by:Ingeborg Hawighorst
ID: 38742469
Now the question for clarification:

Does the cell contain the text "null" or is the cell blank?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:Eirman
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

by:swjtx99
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

by:swjtx99
ID: 38742532
Grateful to get the help!
0
 
LVL 23

Expert Comment

by:Eirman
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question