情景描述: 将规格提取为上下限,并对指定区域数据进行判定,满足上下限的数据显示OK,不满足的显示NG;
下限:
=LEFT($D10,FIND(" ",$D10)-1)+RIGHT($D10,LEN($D10)-FIND("/",$D10))
上限:
=LEFT($D10,FIND(" ",$D10)-1)+MID($D10,FIND("+",$D10)+1,FIND("/",$D10)-FIND("+",$D10)-1)
判定:
{=IF(ISBLANK(Q10),P10,IF(AND((H10:L10)>=P10,(H10:L10)<=Q10),"OK","NG"))}
备注:不合格数据用条件格式标注其它颜色。
情景描述: 判断A列值小于500且B列为已到期,返回"补款"否则为合格;
IF+And 并列条件判断
C5=IF(AND(A5<500,B5="未到期"),"补款","合格")
Index+Match:条件查询
C19=INDEX(B13:G16,MATCH(B19,A13:A16,0),MATCH(A19,B12:G12,0))
情景描述: Iferror+Vlookup:查找值并屏蔽错误;
B30=IFERROR(VLOOKUP(A30,A24:G27,4,FALSE),"")
C40=LEFT(A40,FIND(" ",A40)-1)+RIGHT(A40,LEN(A40)-FIND("/",A40))
D40=LEFT(A40,FIND(" ",A40)-1)+MID(A40,FIND("+",A40)+1,FIND("/",A40)-FIND("+",A40)-1)
情景描述: LEFT+FIND+RIGHT+LEN计算比例;
C43=IFERROR(IF(ISBLANK(A43),"",LEFT(A43,FIND("/",A43)-1)/RIGHT(A43,LEN(A43)-FIND("/",A43))),"")
情景描述: Left+LenB+Len:分离汉字、数字、字母;
C53=LEFT(A53,LENB(A53)-LEN(A53))
情景描述: Index+Small+Row:一对多查找
备注:ROW($B 61 : 61: 61:B$69)-60这里的60要根据数据所在行进行更改!!
数组公式要用三键!!
F61=INDEX($C$61:$C$69,SMALL(IF($B$61:$B$69=$E$61,ROW($B$61:$B$69)-60),ROW(A1)))
情景描述: Sum+Offset+Count:最后N天求和;
E75=SUM(OFFSET(C74,COUNTA(C75:C86)-7,0,7,1))
情景描述: Sumproduct+Countif:统计不重复个数;
D92=SUMPRODUCT(1/COUNTIF(B92:B103,B92:B103))
F92=SUMPRODUCT(COUNTIF(B92:B103,C92:C103))
情景描述: Vlookup+Column:一次性查询多字段数据;
H109=VLOOKUP($G$109,$A$109:$E$115,COLUMN(B108),0)
情景描述: Vlookup+If:多条件查询;
注:数组公式要用三键!!
G121=VLOOKUP(E121&F121,IF({1,0},A121:A129&B121:B129,C121:C129),2,FALSE)
=IF(ISNUMBER(MIN(--LEFT(A135,1),--LEFT(B135,1),--LEFT(C135,1),--LEFT(D135,1),--LEFT(E135,1),IF(LEFT(F135,1)="",1,--LEFT(F135,1)))),0,1)
=COUNTA(A135:F135)-SUM(--ISNUMBER(--LEFT(A135,1)),--ISNUMBER(--LEFT(B135,1)),--ISNUMBER(--LEFT(C135,1)),--ISNUMBER(--LEFT(D135,1)),--ISNUMBER(--LEFT(E135,1)),IF(LEFT(F135,1)="",0,--ISNUMBER(--LEFT(F135,1))))
B170==VLOOKUP($A$170,$A$160:$F$166,COLUMN(B1),TRUE)
B193=LEFT(A193,LENB(A193)-LEN(A193))
B226=IF(LENB(LEFT(A226,1))=1,"国外","国内")
情景描述: 等比等差数列;
B3=IF(MOD(ROW(),2)=1,SUM(B1,4),"")
C4=IF(MOD(ROW(),3)=1,SUM(C1,4),"")
D5=IF(MOD(ROW(),4)=1,SUM(D1,4),"")
F5=IF(MOD(ROW(),4)=1,PRODUCT(F1,4),"")
Sub 隐藏()
MsgBox "隐藏当前工作簿中的所有图表!"
ActiveWorkbook.DisplayDrawingObjects = xlHide
End Sub
Sub 显示()
MsgBox "显示当前工作簿中的所有图表!"
ActiveWorkbook.DisplayDrawingObjects = xIDisplayShapes
End Sub
Private Sub Workbook_Activate()
Call isuser
'Called when Addin is installed
Call AddFourierMenuItem
End Sub
Private Sub Workbook_Deactivate()
'Called when Addin is uninstalled
Call RemoveFourierMenuItem
End Sub
Private Sub AddFourierMenuItem()
Dim ToolsMenu As CommandBarPopup
Dim NewMenuItem As CommandBarButton
'Remove if already exists
Call RemoveFourierMenuItem
'Find Tools menu
Set ToolsMenu = Application.CommandBars(1).FindControl(ID:=30007)
If ToolsMenu Is Nothing Then Exit Sub
'Add Spectral Analysis menu item
Set NewMenuItem = ToolsMenu.Controls.Add(Type:=msoControlButton)
NewMenuItem.Caption = "Pro5 THF Read"
NewMenuItem.OnAction = "data_read"
Set NewMenuItem = ToolsMenu.Controls.Add(Type:=msoControlButton)
NewMenuItem.Caption = "Get AVG Data"
NewMenuItem.OnAction = "get_avg_data"
Set NewMenuItem = ToolsMenu.Controls.Add(Type:=msoControlButton)
NewMenuItem.Caption = "SHEETS CLEAR"
NewMenuItem.OnAction = "sheet_clear"
Set NewMenuItem = ToolsMenu.Controls.Add(Type:=msoControlButton)
NewMenuItem.Caption = "NumberFormat_Erro"
NewMenuItem.OnAction = "DeleteNumberFormat"
End Sub
Private Sub RemoveFourierMenuItem()
Dim CmdBar As CommandBar
Dim Ctrl As CommandBarControl
On Error Resume Next
Set CmdBar = Application.CommandBars(1)
Set Ctrl = CmdBar.FindControl(ID:=30007)
Call Ctrl.Controls("Pro5 THF Read").Delete
Call Ctrl.Controls("SHEETS CLEAR").Delete
Call Ctrl.Controls("Get AVG Data").Delete
Call Ctrl.Controls("NumberFormat_Erro").Delete
End Sub
Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As Range)
Call WorksheetChange(sh, Target)
End Sub
Public Sub avgst()
Application.DisplayAlerts = False
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ThisWorkbook.Close False
End Sub
Public Sub isuser()
Dim iuser
iuser = Environ("username")
cuser = Environ("computername")
user_name = [{"yfyao","Administrator","wangdong","ydb","daijl","Administrators","trioptics","zmhao","jxhu","haohou","huangzhen","liug","liujian","lyc","lyl","luy","mengxp","rxh","shaowl","shenyn","xuping","yyc","zhangyy","xingc","gxcaoty"}]
For I = 1 To UBound(user_name)
If user_name(I) = iuser Then Exit For
Next
If I > UBound(user_name) And InStr(cuser, "GC") = 0 And InStr(cuser, "gc") = 0 And InStr(cuser, "JT") = 0 Then
MsgBox "【此版本为内测版本】" & Chr(10) & "非授权电脑,请勿使用"
Call avgst
End If
End Sub
分享:
能力的提高离不开人的勤奋,勤奋是能力发展的重要条件。勤奋的人不懈地从事活动,他们刚毅顽强、百折不挠,促进了能力的发展和提高。能力与知识、技能是密切联系的。知识、技能是能力形成的基础,并能促进能力的发展。能力制约着掌握知识技能的快慢、深浅、难易和巩固程度,知识、技能的掌握又会导致能力的提高。能力是一种魅力和力量。注重才能的积累远比注重薪水的多少更重要,因为它是每个人最厚重的生存资本。自学能力在能力体系中占有重要的地位,是创造者的有力武器。努力培养和强化自学能力,才能使我们走上创造之路。