简体   繁体   中英

Formula to return the maximum value from 3 columns, but only include a column if the column if the heading appears in a text in another cell

I'm looking for a bit of help with a formula to return a Maximum value from a number of columns(BSS, HPRSS, PBSS), but only if the column heading appears in the column what to calculate!

If it doesn't then it needs to be excluded from the return.

Being honest I don't know where to begin, and I've searched for similiar solutions but can't find anything useful.

My Dataset is laid out as below

A    B     C        D                    E

BSS HPRSS  PBSS     What to Calculate

$50 $100   $500     BSS or HPRSS           

The formula would be in E to return the max of the headings that appear in D which in this case is the greater of BSS and HPRSS ($100) Any help would be appreciated.

Thanks

Use this formula:

=MAX(IF(ISNUMBER(SEARCH(A1:C1,$D$2)),A2:C2))

and press CTRL + SHIFT + ENTER to evaluate it.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM