+ Reply to Thread
Results 1 to 3 of 3

How to use VLOOKUP for a ranges of values in an equation

  1. #1
    Registered User
    Join Date
    06-20-2012
    Location
    Chapel Hill, NC
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question How to use VLOOKUP for a ranges of values in an equation

    I need to calculate the Root Mean Square Deviation for various ranges of values. In the basic spreadsheet I attached, there are two sheets, DATA and ANALYSIS. DATA contains two columns (spectroscopic data, wavenumbers and absorbances in Columns 1 and 2) and has >17,000 rows. In ANALYSIS I have a set of rows with Upper and Lower Wavenumber columns. I need to calculate the RMS Deviation for the absorbance values in the range between the Upper and Lower Wavenumbers using the equation:
    =SQRT(DEVSQ(a:b)/COUNTA(a:b))
    where a and b are the absorbances at the Upper/Lower Wavenumbers. I tried the following equation to calculate it:

    =SQRT(DEVSQ(VLOOKUP(B2,Data!A2:B17010,2,TRUE):VLOOKUP(c2,Data!A2:B17010,2,TRUE))/COUNTA(LOOKUP(B2,Data!A2:B17010,2,TRUE):VLOOKUP(c2,Data!A2:B17010,2,TRUE))

    but it gives an error. Is there a way to use VLOOKUP in an equation like this?
    Attached Files Attached Files

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to use VLOOKUP for a ranges of values in an equation

    To get you on the right track, this would be the way to sum the values between the specified limits:

    =SUM(INDEX(Data!B:B,MATCH(B2,Data!A:A,1)):INDEX(Data!B:B,MATCH(C2,Data!A:A,1)))

    that sums the range: Data!B6639:B6665

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to use VLOOKUP for a ranges of values in an equation

    Using the method I suggested you could use:

    =SQRT(DEVSQ(INDEX(Data!B:B,MATCH(B2,Data!A:A,1)):INDEX(Data!B:B,MATCH(C2,Data!A:A,1)))/(MATCH(C2,Data!A:A,1)-MATCH(B2,Data!A:A,1)+1))

    which gives a result of: 0.007313

    This version gives your expected result of 0.007336

    =SQRT(DEVSQ(INDEX(Data!B:B,MATCH(B2,Data!A:A,1)+IF(ISNUMBER(MATCH(B2,Data!A:A,0)),0,1)):INDEX(Data!B:B,MATCH(C2,Data!A:A,1)+IF(ISNUMBER(MATCH(C2,Data!A:A,0)),0,1)))/(MATCH(C2,Data!A:A,1)-MATCH(B2,Data!A:A,1)))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1