Excel公式将两个具有颜色的列进行比较,并获取具有琥珀色的列的数据 [英] Excel formula to compare two columns with colour and get the data of the column which has Amber colour

查看:110
本文介绍了Excel公式将两个具有颜色的列进行比较,并获取具有琥珀色的列的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两列AA和AB列,它们用不同的颜色填充,我的公式应该比较AA和AB列,找出哪一列具有琥珀色,并在J列中显示该列的值

I have two columns AA and AB columns which are filled with different colours, my formula should compare AA and AB column and find out which column have the Amber colour and display the value of that column in J column

我试图从AB中提取值并在J列中对其进行更新,但无法将AA和AB列与颜色进行比较,并且无法基于该值来提取值.

I have tried to extract the value from AB and update it in the J column, but not able to compare AA and AB column with colour and based on that extract the value.

=INDEX($1:$1048576,I11,28)

推荐答案

为此,您可能需要VBA,所以也许UDF可以帮助您(快速写一些东西):

You probably need VBA for this, so maybe an UDF would help you out (something quickly written):

Function AMBER(RNG1 As Range, RNG2 As Range) As String

If RNG1.Interior.Color = 48895 Then AMBER = RNG1.Value
If RNG2.Interior.Color = 48895 Then AMBER = RNG2.Value

End Function

J1的方式调用:

=AMBER(AA1,AB1)

向下拖动..

这篇关于Excel公式将两个具有颜色的列进行比较,并获取具有琥珀色的列的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆