有什么方法可以在Excel中创建具有多种条件的超链接?

发布于 2025-01-17 15:42:40 字数 236 浏览 1 评论 0 原文

原始帖子中的一个扩展问题:

是否有任何方法可以使用多个条件链接? 如果 /和语句,我需要使用吗?

An extended question from the original post: Conditional Hyperlink if Value from Sheet1 Matches Value in Sheet2

Is there any way to hyperlink with multiple conditionals?
Would I need to utilise IF / AND statements? ????

FOR EXAMPLE:
When data in two different columns in Sheet 1, B2 ("Number") and C2 ("Letter"), MATCH two columns in Sheet 2, A2 ("Number) and Column B2 ("Letter"), then cell A2 ("Link") in Sheet 1 hyperlinks to A2 in Sheet 2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烛影斜 2025-01-24 15:42:40

我能够弄清楚它,并希望发布其逻辑(如果它被证明对其他人有帮助的话)。有点长,但想尽可能多地解释以[希望]帮助您理解

I was able to figure it out and wanted to post the logic should it prove to be helpful to anyone else. It's a bit lengthy but wanted to explain as much as possible to [hopefully] assist your understanding ????:

Formula Used...

=IFERROR(HYPERLINK("#"&CELL("address",INDEX(Sheet2!$A:$A,MATCH(1,(Sheet2!A:A=Sheet1!B2)*(Sheet2!B:B=Sheet1!C2),0))), "Link"),"Hyperlink Error")

Basically translates to...

If any value in Column A of Sheet2 is an exact match to B2 in Sheet1 AND any value in Column B of Sheet2 exact match to C2 in Sheet1, HYPERLINK to that relevant cell in Column A of Sheet2 (A5 in this case) and display "Link" in place of the formula; Otherwise (if error), display "Hyperlink Error"

To break it down...

Formula Syntax :

  • IFERROR(value, value_if_error)
  • HYPERLINK(link_location, [friendly_name])
  • CELL(info_type, [reference])
  • INDEX(array, row_num, [column_num])
  • MATCH(lookup_value, lookup_array, [match_type])

Formula Breakdown :

  1. IFERROR
  • value = the argument that is checked for an error (from HYPERLINK up to MATCH formula)
  • value_if_error = "Hyperlink Error"
  1. HYPERLINK(link_location, [friendly_name])
  • link_location = the path and file name to the document to be opened (from "#"&CELL up to MATCH formula)
  • [friendly_name] = (optional) the text or numeric value that is displayed in the cell ("Link")
  1. CELL(info_type, [reference])
  • info_type = a text value that specifies what type of cell information you want to return ; various types available but the above formula uses "address" which is a reference of the first cell in reference, as text.
  • [reference] = (optional) the cell you want information about (from INDEX up to MATCH formula)
  1. INDEX(array, row_num, [column_num])
  • array = a range of cells or an array constant; Column A of Sheet2

--> If array contains only one row or column, the corresponding row_num or column_num argument is optional.

--> If array has more than one row and more than one column, and only row_num or column_num is used, INDEX returns an array of the entire row or column in array.

  • row_num = selects the row in array from which to return a value ; (our MATCH formula)
  • [column_num] = (optional) selects the column in array from which to return a value ; Not used in our formula
  1. MATCH(lookup_value, lookup_array, [match_type])
  • lookup_value = the value that you want to match in lookup_array ; it can be a value (number, text, or logical value) or a cell reference to a number, text, or logical value ; (the 1 used in our Formula = TRUE ; if FALSE = 0)
  • lookup_array = the range of cells being searched ((Sheet2!A:A=Sheet1!B2)[asterisk](Sheet2!B:B=Sheet1!C2) where the [asterisk] in the middle denotes "AND", meaning both conditions must be met)
  • [match_type] = (optional) specifies how Excel matches lookup_value with values in lookup_array where -1 = greater than, 0 = exact, or 1 = less than (our formula uses "0" to look for an Exact Match)

The End Result...

SHEET1

Sheet1, Formula Translation

SHEET2

Sheet2, Destination Cell to Hyperlink

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文