Search code examples
if-statementgoogle-sheetsgoogle-sheets-querygoogle-sheets-formulags-vlookup

How to populate a value when comparing two columns, VLOOKUP or IF?


I'm trying to create "Sale Rep" summaries by "Shop", where I can simply filter a column by the rep's name, them populate a total sales for each shop next to the relevant filter result.

I'm using this to filter all the Stores by Scott:

=(filter(D25:D47,A25:A47 = "Scott"))

Next, want to associate the Store/Account in F to populate with the corresponding value of E inside of G. So, G25 should populate the value of E25 ($724), G26 with E26 ($822), and F27 with E38 ($511.50)

I don't know how to write the formula correctly, but something like this is what I'm trying to do: =IF(F25=D25:D38),E25 I know that's not right, and it won't work in a fill down. But I'm basically trying to look for and copy over the correct value match of D and E inside of G. So, Misty Mountain Medicince in F27 will be matched to the value of E38 and populated in G27.

The filter is what's throwing me off, because it's not a simple fill down. And I don't know how to match filtered results from one column to a matched value in another.

Hope the screenshot helps. Screenshot of table:

Screenshot of table


Solution

  • Change Field Rep: Scott to Scott and you might apply:

    =query(A25:E38,"select D,E where A='"&F24&"'")