A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Function to return the last value in a contiguous set of data



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2009, 08:42 PM posted to microsoft.public.excel.worksheet.functions
deb
external usenet poster
 
Posts: 898
Default Function to return the last value in a contiguous set of data

I'm wondering if there's a way to have Excel look for a specific value in a
column (e.g. lookup the word "Government" in column A) and then if it finds
that value, to search down to the end of contiguous data following the lookup
value and return the value of the cell on the last row in the third column.

Can this be done?? I feel like it should be possible, but my brain is about
fried tried to figure it out...
  #2  
Old May 12th, 2009, 09:33 PM posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_2_]
external usenet poster
 
Posts: 722
Default Function to return the last value in a contiguous set of data

On Tue, 12 May 2009 12:42:02 -0700, Deb
wrote:

I'm wondering if there's a way to have Excel look for a specific value in a
column (e.g. lookup the word "Government" in column A) and then if it finds
that value, to search down to the end of contiguous data following the lookup
value and return the value of the cell on the last row in the third column.

Can this be done?? I feel like it should be possible, but my brain is about
fried tried to figure it out...


Try this formula:

=INDEX(C1:C100,100-MAX(ISBLANK(OFFSET(A1,MATCH("Government",A1:A100,0 ),0,100))*(100-ROW(OFFSET(A1,MATCH("Government",A1:A100,0),0,100) )))-1)

Note: This is an array formula that has to be entered with
CTRL+SHIFT+ENTER rather than just ENTER.

Change the 100 in 7 places to fit the number of rows with data that
you have in columns A:C.

Hope this helps / Lars-Åke


  #3  
Old May 12th, 2009, 10:55 PM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,722
Default Function to return the last value in a contiguous set of data

=LOOKUP(2,1/(A1:A100="Government"),C1:C100)


"Deb" wrote:

I'm wondering if there's a way to have Excel look for a specific value in a
column (e.g. lookup the word "Government" in column A) and then if it finds
that value, to search down to the end of contiguous data following the lookup
value and return the value of the cell on the last row in the third column.

Can this be done?? I feel like it should be possible, but my brain is about
fried tried to figure it out...

  #4  
Old May 13th, 2009, 01:48 PM posted to microsoft.public.excel.worksheet.functions
deb
external usenet poster
 
Posts: 898
Default Function to return the last value in a contiguous set of data

Unfortunately neither of these solutions quite work because the set of
contiguous data isn't constant. The spreadsheet changes monthly and so the
data might be 100 rows one month, but then only 80 rows the next. In
addition, I need to repeat this several times. So for instance, I need to
find "Government" and then return the value from the end of the set of data
that "Government" is found in for column C. After that, I'll need it to find
"AAA" and then return the value from the end of the set of data that "AAA" is
found in for column C, etc.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.