General Lookup Help

jared511

Board Regular
Joined
Jul 28, 2009
Messages
192
Hello,

I was wondering if it is possible to lookup a value in a row, and have it then return the last value in that same column. So if I am doing a lookup for "FrankC", it would search the row that I specify, and when it found "FrankC" it would return the last value under "FrankC" in the same column "FrankC" is in. Bottom line is that the column with "FrankC" has information by month, and I want the sum of all that info which is the last number in the column.



Thanks,
Jared
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hello,

I was wondering if it is possible to lookup a value in a row, and have it then return the last value in that same column. So if I am doing a lookup for "FrankC", it would search the row that I specify, and when it found "FrankC" it would return the last value under "FrankC" in the same column "FrankC" is in. Bottom line is that the column with "FrankC" has information by month, and I want the sum of all that info which is the last number in the column.
If you have data like this in the range A1:D2

<TABLE style="WIDTH: 152pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=200 border=0 x:str><COLGROUP><COL style="WIDTH: 38pt; mso-width-source: userset; mso-width-alt: 1828" span=4 width=50><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 38pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=50 height=17>Sue</TD><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 38pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" width=50>Tom</TD><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 38pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" width=50>Frank</TD><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 38pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" width=50>Lisa</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17>53 </TD><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">45 </TD><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">90 </TD><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">72 </TD></TR></TBODY></TABLE>

Then:

=SUMIF(A1:D1,"Frank",A2:D2)

Or, using a cell to hold the "lookup" value:

A10 = Frank

=SUMIF(A1:D1,A10,A2:D2)
 
Upvote 0
Jared

Are all the totals on the same row? If so, try this. Otherwise try and give a bit more information about what you have in your sheet, and where.

H2 copied down (if needed on multiple rows).

Excel Workbook
ABCDEFGH
1NameSueTomFrankLisaNameTotal
26761Frank11
36433Sue17
45525
5Total1716119
6
Total
 
Last edited:
Upvote 0
Jared

Are all the totals on the same row? If so, try this. Otherwise try and give a bit more information about what you have in your sheet, and where.

H2 copied down (if needed on multiple rows).

Total

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 8pt; FONT-FAMILY: Arial,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD></TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD><TD>F</TD><TD>G</TD><TD>H</TD></TR><TR style="HEIGHT: 21px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="FONT-SIZE: 10pt">Name</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">Sue</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">Tom</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">Frank</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">Lisa</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt">Name</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">Total</TD></TR><TR style="HEIGHT: 21px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">6</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">7</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">6</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">1</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt">Frank</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">11</TD></TR><TR style="HEIGHT: 21px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">6</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">4</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">3</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">3</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt">Sue</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">17</TD></TR><TR style="HEIGHT: 21px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">5</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">5</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">2</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">5</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD></TR><TR style="HEIGHT: 21px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="FONT-SIZE: 10pt">Total</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">17</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">16</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">11</TD><TD style="FONT-SIZE: 10pt; TEXT-ALIGN: right">9</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD></TR><TR style="HEIGHT: 21px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD><TD style="FONT-SIZE: 10pt"></TD></TR></TBODY></TABLE>
<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=2 border=1><TBODY><TR style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #cacaca"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>H2</TD><TD>=INDEX($A$5:$E$5,MATCH(G2,$A$1:$E$1,0))</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
Or:

=SUMIF(B1:E1,G2,B5:E5)
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,863
Members
452,948
Latest member
UsmanAli786

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