跳到主要内容

如果一个单元格包含Excel中的某些文本,如何在另一个单元格中返回值?

如下例所示,当单元格 E6 包含值“是”时,单元格 F6 将自动填充值“批准”。 如果在 E6 中将“是”更改为“否”或“中立”,F6 中的值将立即更改为“拒绝”或“重新考虑”。 你怎么做才能实现它? 本文收集了一些有用的方法来帮助您轻松解决它。


如果一个单元格包含带有公式的某些文本,则在另一个单元格中返回值

如果一个单元格仅包含特定文本,则要在另一个单元格中返回值,请尝试以下公式。 例如,如果B5包含“是”,则在D5中返回“批准”,否则,返回“不合格”。 请做如下.

选择D5,然后将以下公式复制到其中,然后按 输入 键。 看截图:

分子式: 如果一个单元格包含某些文本,则在另一个单元格中返回值

= IF(ISNUMBER(SEARCH(“USB MIDI(XNUMX通道)",D5)),”批准“,”没有资格")

笔记:

1.在公式中,“USB MIDI(XNUMX通道)D5批准“和”没有资格”表示如果单元格B5包含文本“是”,则将在指定的单元格中填充文本“批准”,否则,将用“否”填充。 您可以根据需要进行更改。

2.要基于指定的单元格值从另一个单元格(例如K8和K9)返回值,请使用以下公式:

= IF(ISNUMBER(SEARCH(“USB MIDI(XNUMX通道)",D5)),K8,K9)

根据特定列中的单元格值轻松选择整个行或选择中的整个行:

选择特定的单元格 实用程序 Kutools for Excel 可以帮助您根据Excel中特定列中的特定单元格值快速选择整个行或所选内容中的整个行。  立即下载 Kutools for Excel 的全功能 60 天免费试用版!


如果一个单元格包含带有公式的不同文本,则返回另一个单元格中的值

如果单元格在Excel中包含不同的文本,本节将向您显示在另一个单元格中返回值的公式。

1.您需要创建一个具有特定值的表,并将返回值分别放在两列中。 看截图:

2.选择一个空白单元格以返回值,在其中键入以下公式,然后按 输入 获得结果的关键。 看截图:

分子式: 如果一个单元格包含不同的文本,则返回另一个单元格中的值

= VLOOKUP(E6,B5:C7,2,假)

笔记:

在公式, E6 是单元格包含您将基于其返回值的特定值, B5:C7 是包含特定值和返回值的列范围, 2 number表示返回值位于表范围的第二列。

从现在开始,将E6中的值更改为特定值时,其对应的值将立即在F6中返回。


如果一个单元格包含不同的文本,则轻松在另一个单元格中返回值

实际上,您可以通过一种更简单的方法解决上述问题。 的 在列表中查找值 实用程序 Kutools for Excel 只需点击几下就可以帮助您实现目标,而无需记住公式。

1.与上述方法相同,您还需要创建一个具有特定值的表,并将返回值分别放置在两列中。

2.选择一个空白单元格以输出结果(此处选择F6),然后单击 库工具 > 公式助手 > 公式助手。 看截图:

3.在 公式助手 对话框,请进行如下配置:

  • 3.1在 选择一个公式 框,找到并选择 在列表中查找值;
    Tips:您可以检查 筛选器 框,在文本框中输入特定单词以快速过滤公式。
  • 3.2在 表格数组 框中,选择不包含您在步骤1中创建的标题的表;
  • 3.2在 查找值 框,选择包含您将要返回值的特定值的单元格;
  • 3.3在 框,指定您要从中返回匹配值的列。 或者,您可以根据需要直接在文本框中输入列号。
  • 3.4点击 OK 按钮。 看截图:

从现在开始,将E6中的值更改为特定值时,其对应的值将立即在F6中返回。 查看结果如下:

  如果您想免费试用(30天)此实用程序, 请点击下载,然后按照上述步骤进行操作。


Kutools for Excel- 帮助您始终提前完成工作,有更多时间享受生活
您是否经常发现自己正在赶上工作,缺乏时间为自己和家人度过?  Kutools for Excel 可以帮你处理 80% Excel 拼图,提高 80% 的工作效率,让您有更多时间照顾家人,享受生活。
适用于300种工作场景的1500种高级工具使您的工作比以往更加轻松。
从现在起,不再需要记住公式和VBA代码,让您的大脑休息一下。
复杂和重复的操作可以在几秒钟内一次性完成。
每天减少成千上万的键盘和鼠标操作,现在告别职业病。
在3分钟内成为Excel专家,帮助您快速获得认可并提薪。
110,000名高效人才和300多家世界知名公司的选择。
使您的$ 39.0的价值超过$ 4000.0的他人培训。
全功能免费试用 30 天。 60 天无理由退款保证。

Comments (98)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
What would I need to add to this formula (Method A) to get a third BLANK option? And where would it go?
Example:
If the cell I'm searching is blank, I would like it to return no value in the other cell. I do not want the "if false" value to populate.
This comment was minimized by the moderator on the site
i want a cell to automatically choose a number based on the drop-down option in the cell before, e.g drop-down, half meal, full meal, if I select half meal drop-down, the next cell should show 50% while the full meal drop-down will reflect 100%. please help
This comment was minimized by the moderator on the site
Hi Josh,
In the cell where you want to output the percentage, enter the following formula and press the Enter key. Hope I can help.
=IF(C15="half meal", "50%", IF(C15="full meal", "100%", ""))
This comment was minimized by the moderator on the site
Is it possible to return a certain value in 1 column based on another?


What I currently have: On a differnt tab (same worksheet):
Column A Column B
Location Name Dept Location Name Location Code
Miami 4455 Miami 123


What I want to happen:
Location Name Dept
Miami 11234455

In Coumn B, I want it to first add a 1, then take what is in Column A, see what is the Location Code on then different tab, insert that location code, and add that to the front of the current data in Column B.

1 + 123 + 4455
This comment was minimized by the moderator on the site
Hi Jen Rader,
You can apply the following formula to get it done.
=IFERROR(1&VLOOKUP(A9,Sheet2!$A$2:$B$5,2, 0)&VLOOKUP(Sheet1!A9,Sheet1!$A$2:$B$5,2, 0),"")
In this formula,
1. A9 is the cell contains the value you want to return values based on;
2. Sheet2 is the tab name contains the "Location Code"; If the tab name contains space, please enclose the tab name in single quotes, such as 'tab name'.
3. Sheet1 is the tab name contains the "Dept";
4. $A$2:$B$5 is the range containing the table data (include both search values and return values ).
See screenshots below:
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/return1.png
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/return2.png
This comment was minimized by the moderator on the site
OMG Crystal! You are amazing! Show me your ways! Thank you so much - it worked exactly like I was hoping!
This comment was minimized by the moderator on the site
I am trying to find out the formula to copy the number shown in B2 on cell D2 if the Cell C2 has a letter "S". Can anyone help me?
This comment was minimized by the moderator on the site
Hi Aurora,
Please enter the following formula in cell D2.
=IF(ISNUMBER(SEARCH("S",C2)),B2,"No qualify")
This comment was minimized by the moderator on the site
Bonjour à tous, j'ai un tableau Excel et j'aimerais réaliser via une macro l'opération suivante: si une cellule contient une date, me renvoyer une valeur dans une autre cellule. Pourriez vous m'aider s'il vous plait? Je vous remercie par avance
This comment was minimized by the moderator on the site
STALLS D 25 Palais - Stalls SR
STALLS M 19 Palais - Stalls SR
LOUNGE E 22 Palais - Lounge SR
LOUNGE G 23 Palais - Lounge SL
ORCH K 40 Palais - Orchestra SR
For each line in a spreadsheet I need to evaluate against a table like above and find the value that matches all of the first 3 values.
Normally I would use sumifs for this type of problem but the answer is a text string so it returns 0
This comment was minimized by the moderator on the site
I need a formula that makes column N equal the text “OTO” if column K equals MCS TRAINING how do I do that???
This comment was minimized by the moderator on the site
Hi Abby,Please apply the following formula in the cells of column N:=IF(ISNUMBER(MATCH("MCS TRAINING",K1)),"OTO","NULL")
This comment was minimized by the moderator on the site
Hi - This is my formula that I am working with.  Currently it works, but where B21 is being returned, the value of B21 is a link to another place altogether.  I want to keep the display text but would like to include the link as well.  Can this be done?  =IF(ISNUMBER(SEARCH("DATA_MAPPING",general_report!AJ21)),general_report!B21,"")
This comment was minimized by the moderator on the site
Is it possible to split the return value to a different tab? IE: columns B and C are located on one tab, and values in columns E and F are located on a different tab?
This comment was minimized by the moderator on the site
Hi

Is it possible to populate another cell, not the cell with the formula.

Example
A1 Yes
A2 3
A3 Formula searches A1, Grabs value at A2 and if Yes Paste it in A4
A4 3 
This comment was minimized by the moderator on the site
Hi,
Sorry can't help you with the problem. I suggest you post the problem to the forum below to get help from other Excel enthusiasts.
https://www.extendoffice.com/forum/kutools-for-excel.html 
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations