?
Solved

How to test for text in Excel formula

Posted on 2014-04-19
2
Medium Priority
?
221 Views
Last Modified: 2014-04-29
I have a numercal value in A1,
Either Y or N (text cell) is in B1
I want C1 to show the numerical value of A1 if B1 contains the text letter Y
0
Comment
Question by:Bill Golden
[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
2 Comments
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 800 total points
ID: 40010812
In cell C1:

=if(B1="Y",A1)
0
 
LVL 24

Assisted Solution

by:SunBow
SunBow earned 400 total points
ID: 40016241
Gerwin Jansen has provided answer as asked.

Question is, however, incomplete, for it does not mention precondition of C1 or potential alternative for B1. Consider case of B1 being blank or numeric or date or some error. Example text of Z or Yes or N/A or y.

This means asker has to have absolute control of everything on the sheets (including formula that may change B1).

To simplify handling an ELSE condition, it is common to include null or blank space text. Example:

    =if(B1="Y",A1,"")            or          =if(B1="Y",A1," ")

A more robust solution would handle condition of B1 being neither Y nor N.

By not handling the other than Y condition, C1 in Excel yields FALSE which is better used as a boolean than a numeric, leading to potential for problems to arise during development.
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

Lately there has been a variety of news related to U.S. employment.  Stories about worker productivity, automobile and airline unions, low employment and foreign laborers have frequented the news.  Each story has good and bad attributes we might arg…
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
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…

770 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