
VLOOKUP 函数:可以按照某一列的数值进行查找,并返回与该值相对应的其他列的值。VLOOKUP 函数的语法为:VLOOKUP(lookup_value, table_array, col_index_num, range_lookup)。其中,lookup_value 是要查找的值,table_array 是要在其中进行查找的区域,col_index_num 是要返回的值在 table_array 中的仿拆橡列数备旁,range_lookup 是一个逻辑值,用于指定查找的类型(精确匹配还是近似匹配)。
HLOOKUP 函数:与 VLOOKUP 函数类似,但是可以按照行来查找数据。HLOOKUP 函数的语法为:HLOOKUP(lookup_value, table_array, row_index_num, range_lookup)。其中,lookup_value 是要查找的值,table_array 是要在其中进行查找的区域,row_index_num 是要返回的值在 table_array 中的行数,range_lookup 是一个逻辑值,用于指定查找的类型(精确匹配还是近似匹配)。
INDEX 和 MATCH 函数:可以通过匹配某一列或行的数值来查找数据。INDEX 函数的语法为:INDEX(array, row_num, [column_num]),其中,array 是要查找的区域,row_num 是要返回的行数,column_num 是要返回的列数(可选)。MATCH 函数的语法为:MATCH(lookup_value, lookup_array, [match_type]),其中,lookup_value 是要查找的值,lookup_array 是要在其中进行查找的区御肢域,match_type 是一个逻辑值,用于指定查找的类型(精确匹配还是近似匹配)。
FIND 和 SEARCH 函数:可以按照文本字符串中的关键字或模式进行查找。FIND 函数的语法为:FIND(find_text, within_text, [start_num]),其中,find_text 是要查找的文本字符串,within_text 是要在其中进行查找的文本字符串,start_num 是一个可选参数,指定开始查找的位置。SEARCH 函数的语法与 FIND 函数类似,但是不区分大小写。
这些函数可以帮助用户在 Excel 中快速定位和查找数据,提高工作效率。
data segmentstring1 db 50,0,50 dup(?)
string2 db 50,0,50 dup(?)
mess1 db 'please enter the first string:','$'
mess2 db 'please enter the second string:','$'
mess3 db 'The first is less than the second.',13,10,'$'
mess4 db 'The first is bigger than the second.',13,10,'$'
mess5 db 'match!',13,10,'$'
data ends
code segment
assume cs:code,ds:data,es:data
start:
push ds
xor ax,ax ax清零
mov ax,data
mov ds,ax
mov es,ax 初始化
输入激渗老喊氏第一个字符串
mov ax,data
mov ds,ax
mov dx,offset mess1
mov ah,09h
int 21h 输出please enter the first string:
mov ax,data
mov ds,ax
mov dx,offset string1
mov ah,0ah
int 21h
call crlf
输入第二个字符明升串
mov ax,data
mov ds,ax
mov dx,offset mess2
mov ah,09h
int 21h 输出please enter the second string:
mov ax,data
mov ds,ax
mov dx,offset string2
mov ah,0ah
int 21h
call crlf
lea si,string1
lea di,string2
add si,2
add di,2
下面是字符串比较
again:
mov bl,byte ptr [di]
cmp [si],bl
jl Little 转到小于输出
jg greate 转到大于输出
add si,1
add di,1
cmp byte ptr [si],0
jnz again
两字符串等于的输出
call crlf
mov ax,data
mov ds,ax
mov dx,offset mess5
mov ah,09h
int 21h
mov ah,4ch
int 21h
小于的输出
Little:
call crlf
mov ax,data
mov ds,ax
mov dx,offset mess3
mov ah,09h
int 21h
mov ah,4ch
int 21h
大于的输出
greate:
call crlf
mov ax,data
mov ds,ax
mov dx,offset mess4
mov ah,09h
int 21h
mov ah,4ch
int 21h
下面这个子程序是用来做 回车换行 用的
crlf proc near
mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
mov ah,2
int 21h
ret
crlf endp
code ends
end start 结束
data segmentstr1 db '备启销mes'
str2 db 'mess'
str3 db '旁液match$'仿游
str4 db 'not match$'
data ends
code segment
assume cs:code ,ds:data
start:
mov ax,data
mov ds,ax
mov es,ax
mov cx,4
mov di,offset str1
mov si,offset str2
repz cmpsb
jz lab1
jnz lab2
lab1:
mov dx,offset str3
mov ah,09h
int 21h
mov ah,4ch
int 21h
lab2:
mov dx,offset str4
mov ah,09h
int 21h
mov ah,4ch
int 21h
code ends
end start
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)