Solved

How to test for text in Excel formula

Posted on 2014-04-19
2
204 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
2 Comments
 
LVL 37

Accepted Solution

by:
Gerwin Jansen earned 200 total points
ID: 40010812
In cell C1:

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

Assisted Solution

by:SunBow
SunBow earned 100 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

With the internet and the ease of information transference, many professional jobs can be done anywhere today.  Why should it make a difference whether an x-ray is read in India or the United States as long as the radiologist is qualified?   Outso…
A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now