当前位置:网站首页>Excel fast l count the number of red data in all lines [commonly used in teaching]
Excel fast l count the number of red data in all lines [commonly used in teaching]
2022-07-18 01:05:00 【Wang xiaowang-123】
Case scenario
Suppose there is one Excel Data sheet for , The row and column dimensions of the data table are relatively large ( There are more columns , There are quite a lot of lines ), Our common Excel The method has been unable to meet our business and teaching analysis needs , Here's how to quickly apply , Solve problems in life .

The goal is 1
Give a data table as follows , We need to fill the cells with colors , Count the number of columns according to each row , Finally, it is shown in our data sheet .

First, fill the data font in the cells with color , Turn red
Using shortcut keys :Ctrl+H, Select the fill format from the cell


Of course , Here you can also use the format flexibly , Suppose our original table is not marked , Only data , Then we can according to the range of data , The type of text , And other data constraints to replace and normalize it
Click Replace All


The goal is 2
Right click on the Sheet1 View code or alt+F11 open VBA namely Visual Basic for Applications, Click Insert >>> modular 
Copy the following code into the box :
Function CountRed1(rng As Range) As Integer
Dim rng1 As Range
CountRed1 = 0
For Each rng1 In rng
If rng1.Font.Color = 255 Then CountRed1 = CountRed1 + 1
Next rng1
End Function


This is success !!!!
Then back Excel Custom insert a row , Used for counting numbers , Input =CountRed1(), Fill in the brackets and click the range you want to count

Then enter and the result will appear !

summary
This technique is very convenient , Little buddy who can't program , Although we can use python To achieve , But for beginners Xiaobai ,python It may not be a simple and efficient way , Sometimes choice is more than effort
边栏推荐
- Compile assimp with vs2022 and load the model based on OpenGL
- Q5对话框(模态和非模态)
- Excuse me, sqlserver CDC to Kafka. Kafka has 12 partitions. There is a way to ensure that the same record is in the same partition
- C语言实现贪吃蛇
- SHAREit Group的技术战略——开放、自立、超前布局
- MFC实现类的序列化
- H5 page in wechat evokes applet & app
- MFC implementation class serialization
- [Huang ah code] Introduction to MySQL - 3. I use select *, and the boss directly rushed me home by train, but I still bought a station ticket
- [Arduino six channel ADC sampling of Renesas ra6m4 development board]
猜你喜欢

【面试题】在 Queue 中 poll()和 remove()有什么区别

Q3 qmainwindow menu bar and toolbar

聊天软件项目开发1

【C语言】进阶指针night

这可是全网网工基础知识最详细的整理,没有之一
![[step on the pit column] solve the problem that the idea plug-in cannot be found](/img/76/192f6d916cd83cfde77113dfe8a0f0.png)
[step on the pit column] solve the problem that the idea plug-in cannot be found

Huitong programming introductory course - 3 colorful
![[Huang ah code] Introduction to MySQL - 3. I use select *, and the boss directly rushed me home by train, but I still bought a station ticket](/img/7b/f50c5f4b16a376273ba8cd27543676.png)
[Huang ah code] Introduction to MySQL - 3. I use select *, and the boss directly rushed me home by train, but I still bought a station ticket

034. Code rollback reset current branch to here

Q4资源文件
随机推荐
hi各位大佬,想请教一下mysql-cdc这里的startupOptions 为什么只支持initi
Luogu daily three questions -- the next day
QPS和TPS的区别
This is the most detailed arrangement of the basic knowledge of network workers in the whole network, and there is no one
【面试题】在 Queue 中 poll()和 remove()有什么区别
Room: writing business code again? Look at me, give you the feeling of flying!
Q3 qmainwindow status bar riveted parts core parts
Cf1265e beautiful mirrors (probability DP)
Analysis of technical design details dynamically displayed or hidden by SAP Fiori application adapt UI
这可是全网网工基础知识最详细的整理,没有之一
Huitong programming introductory course - 3 colorful
Software testing? Monthly salary 20K +? I can't automate the test. It's really hard for me
I would like to ask you guys, how to save the status of this op with Flink SQL
[Arduino six channel ADC sampling of Renesas ra6m4 development board]
Taishan Office Technology Lecture: the source of the grid, may be the Song typeface fourth?
Working sql: it is required that the average number of awards cannot be displayed by ranking
[redis] several ideas and experiments of redis locking
Neuron and metahunan drive whole body steps in real time
Excuse me, sqlserver CDC to Kafka. Kafka has 12 partitions. There is a way to ensure that the same record is in the same partition
Mongoose fuzzy query (single condition and multi condition)