Solved

How to test for text in Excel formula

Posted on 2014-04-19
2
209 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 38

Accepted Solution

by:
Gerwin Jansen, EE MVE 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visio 2010 - Linking Spreadsheets 5 83
Excel IF/OR formula not working. 8 68
Word: Is there a way to "hide" text? 12 36
Excel Sheet Data Finding 14 11
Meetings to discuss business process can waste time, and often do .  The meeting's dialog can get confusing when participants have different professional perspectives and backgrounds.  A jointly-developed process picture helps wade through the confu…
This article will shed light on the latest trends when it comes to your resume building needs. For far too long, the traditional CV format has monopolized the recruitment market.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
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…

840 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