根据其他小区的位置返回小区的内容

时间:2015-10-14 12:51:51

标签: excel excel-formula

我正在尝试构建一个搜索整个列的函数,比如列A,搜索一串文本。我需要函数将单元格的值返回到包含字符串的单元格右侧的两个位置。因此,例如,如果在A17中找到该字符串,则该函数返回C17的值。 我正在尝试使用搜索功能,但我卡住了。有人可以帮忙吗?

到目前为止我得到了什么:

=SEARCH("search text"; $A:$A; MATCH($C$C ....)

2 个答案:

答案 0 :(得分:1)

以下是如何操作:

    Dim TRSSession
    Dim GUID
    Dim RemoteIP

GUID = CStr(Request.Cookies("TRSSession"))
RemoteIP = Request.ServerVariables("REMOTE_ADDR")

If Not IsObject(Session("TRSSession")) Then
    Set TRSSession = Server.CreateObject("CAMSSession.TRSSession")
    Call TRSSession.Constructor(Application.Value("strSvrName"), Application.Value("strDBName"))
    TRSSession.PortalServiceURI = Application.Value("PortalService")
    TRSSession.IP = RemoteIP
    TRSSession.AllowBatchMode = True
    Set Session("TRSSession") = TRSSession
    TRSSession.Acquire GUID, RemoteIP
Else
    Set TRSSession = Session("TRSSession")
End If

If GUID = "" Then
    If LCase(Request.ServerVariables("HTTPS")) = "on" Then
        Response.AddHeader "Set-Cookie", "TRSSession=" & CStr(TRSSession.GUID) & "; secure; HttpOnly"
    Else
        Response.AddHeader "Set-Cookie", "TRSSession=" & CStr(TRSSession.GUID) & "; HttpOnly"
    End If
End If

Dim TRSSessionF

If Request.QueryString("GUID") <> "" Then
    Set TRSSessionF = Server.CreateObject("CAMSSession.TRSSession")
    Call TRSSessionF.Constructor(Application.Value("strSvrName"), Application.Value("strDBName"))
    TRSSessionF.PortalServiceURI = Application.Value("PortalService")
    TRSSessionF.IP = RemoteIP
    TRSSessionF.Acquire Request.QueryString("GUID"), RemoteIP, True
    TRSSession("TermID") = TRSSessionF("TermID")
    TRSSession("TextTerm") = TRSSessionF("TextTerm")
    TRSSession("SROfferID") = TRSSessionF("SROfferID")
    TRSSession("CourseName") = TRSSessionF("CourseName")
    TRSSession("Course") = TRSSessionF("Course")
    TRSSession("FacultyID") = TRSSessionF("FacultyID")
    TRSSession("FPM") = "True"
    TRSSession("StudentName")= "<span style=""color:Red"">Faculty Preview Mode</span>"
End If

%>

如果Excel本地化使用分号而不是逗号用于列表分隔符,则公式为:

=INDEX(C:C,MATCH("search text",A:A,))

答案 1 :(得分:1)

使用匹配()索引() ......................... ..............

enter image description here

注意星号。