Forum Discussion

Jaxtonv's avatar
Jaxtonv
Copper Contributor
Jan 04, 2021

Using data in formulas from different worksheets

I have two different worksheets that are tables with data that is listed by city. Each worksheet is a separate day. I want to calculate the difference in the two days of revenue. But some pages have a different amount of cities so they don’t necessarily line up to the same row. So New York might occupy the same row as Philadelphia on a different worksheet. Is there a way to match the names in column 1 and using that row of information before calculating the formula?

6 Replies

  • mtarler's avatar
    mtarler
    Silver Contributor

    Jaxtonv This can be done with a variety of functions: XLOOKUP, VLOOKUP, LOOKUP, a combination of INDEX and MATCH, or others.  If you provide a sample workbook we can be a little more specific on how to use it, otherwise, just look at the help information about what values need to be passed to it.

    • Jaxtonv's avatar
      Jaxtonv
      Copper Contributor
      Here is a sample the sample of the spreadsheet. I want to compare the yesterday columns on each spreadsheet but the cities change order so are not in the same row between the worksheets.
      • mtarler's avatar
        mtarler
        Silver Contributor

        Jaxtonv  In the attached I ended up using a SUMIFS() formula because there wasn't a single unique column to use for the lookup (i.e. there are 2x Gainsville locations).  I also used table notation which might be a little harder for you to read if you aren't familiar with it.  And lastly I added the IFERROR() and the 1/1/ to detect if nothing was found BUT if the lookup value is or could be 0 this 'trick' is not good.  But then again if when they aren't on list you prefer to assume they are 0 then simply remove the IFERROR() and the 1/1/.  Since I don't know all the details of what you need I'm trying to give you options.  

Resources