Query cells in a row to match in another table to return a true false statement.

stacilou

New Member
Joined
Oct 5, 2017
Messages
2
Hey ya'll,

I'm trying to summarize some Line-Point Intercept data and would like to able to summarize it by plant functional group.

ptTop Canopy123Soil SurfaceShrubPerennial GrassAnnual GrassPerennial ForbAnnual Forb
1QUGAPOPRACMI2lsTrueTrueTrue
2QUGAPOPRls
3QUGASYOR2POPRls
4QUGASYOR2POPRls
5QUGASYOR2ls
6QUGASYOR2POPRls
7QUGASYOR2POPRls
8QUGASYOR2POPRls
9QUGASYOR2POPRls

The second row is what I would like the whole table to look like. Like if there are two shrubs, I would like it to just return a True value, same with Perennial and Annual grasses/forbs. I have a Master species sheet with all the plant codes and duration, or I have a master species list that has all the plants separated by functional group (Shrub, Perennial Grass, Annual Grass, Perennial Forb, Annual Forb).

My first thought was to separate the master species into functional groups, then use those lists. I would use a lookup or match function to look in the entire row, then return a True or False; or a 1 or 0. Example row 2 in the table. Any suggestions?

Thank you!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
The way i'd usually do this is VLOOKUP and LEN.

so the VLOOKUP will return the code "POPR" for example and LEN will confirm it's there.

=VLOOKUP(C2,'Master species sheet'!A:A,1,0) to get "POPR"

and

=IF(LEN(VLOOKUP(C2,'Master species sheet'!A:A,1,0) )>1,"True","")

The LEN of the return being 4, which is greater than 1, therefore True. If not found it will be #N/A! so the IFERROR changes that to a blank.

=IFERROR(IF(LEN(VLOOKUP(C2,'Master species sheet'!A:A,1,0) )>1,"True",""),"")
 
Last edited:
Upvote 0
Do you know of anyway I could look up the row? I would like excel to search B2:F2, look in in the Shrub Functional group and return "True" or "1", I could then use the same formula, just changing the Functional Group list to match from. Does that make sense and is it possible? Haha!
 
Upvote 0
So you'd like to see if any value in B2 or F2 is in another table? There would be an array method and i'm sure someone else will assist there.

A possible workaround is just adding another vlookup to the error, and again etc.

=IFERROR(IF(LEN(VLOOKUP(B2,'Master species sheet'!A:A,1,0) )>1,"True",""),IF(LEN(VLOOKUP(C2,'Master species sheet'!A:A,1,0) )>1,"True",""))

=IFERROR(IFERROR(IF(LEN(VLOOKUP(B2,'Master species sheet'!A:A,1,0) )>1,"True",""),IF(LEN(VLOOKUP(C2,'Master species sheet'!A:A,1,0) )>1,"True","")),IF(LEN(VLOOKUP(D2,'Master species sheet'!A:A,1,0) )>1,"True",""))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,790
Messages
6,126,911
Members
449,348
Latest member
Rdeane

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