VLOOKUP greatest value of multiple text inputs

Andreasegeland

New Member
Joined
Jan 24, 2019
Messages
4
Dear Community,

I am currently trying to do a VLookup and I was hoping you guys could help me save some time. I want to lookup multiple text inputs and return the greatest value among those inputs. I am sure this is a simple task and I am afraid I have over complicated it. This is for a structural engineering purpose where I am trying to find the maximum deflection of beams. The basics behind it is that the primary beams carry the secondary beams. If the primary beams deflect, the secondary will have added deflection to their total deflection. I will be doing a lot of changes to the layout of beams and the design will most likely change, so I need a way to keep track of my total deflection in an efficient way. Therefore, I wish to write a string which I believe would be something like this:

D2= C2+(IF_lookup B1 = SECONDARY, VLOOKUP_E2 (beampair)_return highest value of beams in column A or F corresponding to those listed in beampair E2, IF_lookup B1 = PRIMARY, FALSE/0)

The reason it is complicated is that for example in row 6 column E. There are more than one primary beam, so the total value of deflection D6 needs to have C6 + the highest of those listed in the beam pair. I don't know how it works when you have commas like these and text.

I would appreciate any attempts on this, and I would be happy to learn from this because I have a feeling it can be done in an easier way.

Thank you in advance,

Andreas

ABCDEFGHIJ
1BEAM CALC REFPRIMARY/SECONDARYDEFLECTION (mm)TOTAL DEFLECTION (INC PRIMARY BEAM DEFLECTIONS) (mm) BEAM PAIR BEAM CALC REF PRIMARY/SECONDARYDEFLECTION (mm)TOTAL DEFLECTION (INC PRIMARY BEAM DEFLECTIONS) (mm)BEAM PAIR
2FB01ASECONDARY34.3=C2 + VLOOKUP (FB02, SB03) FB02SB01PRIMARY5=F2
3F B01BSECONDARY13.8=C3 + VLOOKUP FB34SB02PRIMARY 4=F3 FB05A
4FB02APRIMARY11.1=C4 FB01ASB03PRIMARY31=F4 FB01A + FB05A
5FB02BPRIMARY18.9=C5 SB06 SB04SECONDARY 11 =F5 + VLOOKUP FB34
6FB05ASECONDARY4.2=C6 + VLOOKUP SB02, SB03, SB05SB05PRIMARY 12=F6FB05A

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Re: VLOOKUP greatest value of mulitple text inputs

Hi, welcome to the board.

This is probably do-able but I'm struggling to understand your post.

Don't worry too much about explaining the details of why different combinations of beams deflect by different amounts, that's probably not really relevant to the Excel solution.
Focus on what data you have, and what exactly you want to do with it.

I think I get what you want to do with in cell D2, but am struggling with the details.

D2= C2+(IF_lookup B1 = SECONDARY, VLOOKUP_E2 (beampair)_return highest value of beams in column A or F corresponding to those listed in beampair E2, IF_lookup B1 = PRIMARY, FALSE/0)
First, I don't think you need a lookup for the red text above.

I think you can replace this with
D2= C2+(B2 = "SECONDARY", VLOOKUP_E2 (beampair)_return highest value of beams in column A or F corresponding to those listed in beampair E2, IF_lookup B1 = PRIMARY, FALSE/0)

Next, please explain, what exactly you want to look up against on the beams, because it's not clear to me.
 
Upvote 0
Re: VLOOKUP greatest value of mulitple text inputs

Hi Gerald,

Thank you for your response! I agree with you that I dont need the lookup.

I basically want to find the highest deflection value from the text inputs in the "Beam Pair" cell (Column E).

I made it work with:

D2=C2+(IF(B2="SECONDARY",(VLOOKUP(E2,A2:E6,4,FALSE)), 0))

However, my problem now is that if more than one beam is paired, i.e I have FB02, SB06 in cell E2. I want the Vlookup to be written so that it checks the value of both beam FB02 and SB06 and returns me the highest value and adds it to its own deflection.

I can always create another column with the second paired beam and then pick the highest value, but I want to avoid having many columns of data as there might be up to 4 paired beams so it would be better to keep all of them in one cell.

I hope this helps, I am sorry for making it slightly confusing.

Regards,

Andreas
 
Upvote 0
Re: VLOOKUP greatest value of mulitple text inputs

I see, so cell E2 contains the entry "FB02, SB06", yes ?

And you want to carry out two separate lookups, one on FB02 and one on SB06, and then select one of them based on the results of the lookup, yes ?

That can be done but I would strongly recommend using separate columns for each entry.

That way it will be much easier (in my opinion) to check the formula is delivering the correct results.

If you have two entries in a single cell, then you will have to add complicated formulas which work out which part of the single cell's entry should be dealt with by the first lookup, and which by the second.
 
Upvote 0
Re: VLOOKUP greatest value of mulitple text inputs

Gerald,

Thank you, after spending some time on it I realise it is easier to just add three more columns.

Please let me know if you can think of a more efficient way than this:

=D4+(IF(B4="SECONDARY",(MAX(IF(G4>1,VLOOKUP(G4,A4:K42,6,FALSE),0),(IF(H4>1,VLOOKUP(H4,A4:K42,6,FALSE),0)),(IF(I4>1,VLOOKUP(I4,A4:K42,6,FALSE),0)))),0))

BEAM
CALC REF
PRIMARY/
SECONDARY
STATUSDEFLECTION (mm)DEFLECTION FROM IMPOSED (mm)TOTAL DEFLECTION (INC PRIMARY BEAM DEFLECTIONS) (mm)BEAM PAIR
FB01ASECONDARYC34.3553.2FB02AFB02BFB05A
FB01BSECONDARYC13.86.213.8FB34
FB02APRIMARYA11.12.311.1FB01A
FB02BPRIMARYA18.9618.9SB06
FB05APRIMARYA4.22.14.2SB02SB09FB05B

<colgroup><col span="2"><col><col><col><col><col span="3"></colgroup><tbody>
</tbody>


Thanks again for your time!

Regards,

Andreas
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top