Excel索引与if语句匹配?

时间:2017-02-03 11:18:12

标签: excel indexing

我有一个包含2个工作表的工作簿:

第3页

func attributedText()-> NSAttributedString
{
    let string = "TERMS OF SERVICE\nLast Updated: May 7, 2015\n\nPLEASE NOTE: The HIGO Terms of Service as stated below is effective as of the 'Last Updated' date above for any user who is browsing the HIGO website, or for any user who creates a HIGO account on or after that date." as NSString

    let attributedString = NSMutableAttributedString(string: string as String, attributes: [NSFontAttributeName:UIFont.systemFont(ofSize: 15.0)])

    let boldFontAttribute = [NSFontAttributeName: UIFont.boldSystemFont(ofSize: 15.0)]

    // Part of string to be bold
    attributedString.addAttributes(boldFontAttribute, range: string.range(of: "TERMS OF SERVICE"))
    attributedString.addAttributes(boldFontAttribute, range: string.range(of: "PLEASE NOTE:"))

    // 4
    return attributedString
}

第2页

Column F          Column D         Column K
Supplier A        1234             10
Supplier B        2222             4

我正在尝试编制索引匹配公式,该公式将检查项目编号和供应商名称,并从K列返回值。

但是,如果该值为7或更高,那么我想要替换该值并且无限期地使用'

以下是一个例子:

第2页

Column D         Column G
Supplier A       1234 - Other
Supplier B       2222 - Other

有人可以告诉我该怎么做吗?

目前我的代码给了我这个:

第2页

Column D         Column G         Column P
Supplier A       1234 - Other     Indefinitely 
Supplier B       2222 - Other     4

代码:

Column D         Column G         Column P
Supplier A       1234 - Other     Indefinitely 
Supplier B       2222 - Other     Indefinitely 

由于

1 个答案:

答案 0 :(得分:0)

= IF(INDEX(数据K:K,MATCH(D2,数据F:F,0),0)> = 7"无限期",INDEX(数据K:!!k来,MATCH(D2,数据F:!女,0),0))

无需Ctrl + Shift + Enter