如果单元格以文本字符串开头...公式 [英] If Cell Starts with Text String... Formula

查看:114
本文介绍了如果单元格以文本字符串开头...公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个公式,检查单元格是否以文本开头A返回收取B,收取C作为预付款。



但是它不似乎正常工作



A和C都返回Prepaid ...



= LOOKUP(LEFT(A1),{A,B,C},{Pick Up,Collect,Prepaid})

解决方案

我不确定查找是正确的公式,因为多个参数。也许 hlookup vlookup ,但是这些要求您使用表的值。一个简单的嵌套系列的 if 为小样本大小提供了技巧



尝试
= IF(A1 =a,pickup,IF(A1 =b,collect,IF A1 =c,预付,)))



现在将您的 c $ c


= IF(LEFT(A1,1)=a,pickup,IF(LEFT(A1, 1)=b,collect,IF(LEFT(A1,1)=c,prepaid,)))



还请注意您使用 left ,您的论点不指定字符数,但一组。






7/8/15 - 上述功能的Microsoft知识库文章。我不认为与 techonthenet 有任何错误,但我宁愿链接到官方来源。




I have formula that checks if the cell starts with text "A" returns Pick up "B" for Collect and C for Prepaid.

But it doesn't seems to be working properly

Both A and C returns Prepaid...

=LOOKUP(LEFT(A1),{"A","B","C"},{"Pick Up","Collect","Prepaid"})

解决方案

I'm not sure lookup is the right formula for this because of multiple arguments. Maybe hlookup or vlookup but these require you to have tables for values. A simple nested series of if does the trick for a small sample size

Try =IF(A1="a","pickup",IF(A1="b","collect",IF(A1="c","prepaid","")))

Now incorporate your left argument

=IF(LEFT(A1,1)="a","pickup",IF(LEFT(A1,1)="b","collect",IF(LEFT(A1,1)="c","prepaid","")))

Also note your usage of left, your argument doesn't specify the number of characters, but a set.


7/8/15 - Microsoft KB articles for the above mentioned functions. I don't think there's anything wrong with techonthenet, but I rather link to official sources.

这篇关于如果单元格以文本字符串开头...公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆