03-17-2010, 11:34 AM | #1 | ||
Coordinator
Join Date: Oct 2000
Location: Big Ten Country
|
Another Excel help thread
I'm trying to use the sumif function, but instead of a column of cells in my test range, I want to make my test range the same cell in 20 different tabs. So here's my formula:
=SUMIF('40033:61101'!$A$2,$A$2,'40033:61101'!$B$26) Where 40033....61101 are the 20 tabs. If cell A2 of that tab is the same as cell A2 of the tab my formula is in, I want to add cell B26 of that tab. But sumif doesn't like it when I go across tabs like that instead of a range within one tab. Any ideas? |
||
03-17-2010, 12:52 PM | #2 | |
College Prospect
Join Date: Nov 2006
Location: High and outside
|
I think you have to go with SUMPRODUCT. I stole this from teh intarwebs:
Quote:
|
|
03-17-2010, 01:24 PM | #3 |
College Starter
Join Date: Dec 2006
|
I was thinking something like what Bobble had posted in Option 1. But I dont think you're looking for the product.
Do you have Excel 2007 or 2003? |
03-17-2010, 01:36 PM | #4 |
Coordinator
Join Date: Oct 2000
Location: Big Ten Country
|
Right, I'm not looking for a product -- just a sum. I'm not really following Bobble's example right now, but I've got a decent enough workaround going now anyway. I have Excel 2003.
|
03-17-2010, 01:56 PM | #5 |
College Starter
Join Date: Dec 2006
|
Without using an aggregation Worksheet (or range of cells) you could use 20 SUMIF statements.
If that sounds like a terrible idea (or 2003 does not support that many characters/functions in a formula)...I think you might need to just make an aggregation worksheet (or range of cells) to each perform a SUMIF for you. Then you could just add that range of cells. |
03-17-2010, 01:59 PM | #6 |
College Prospect
Join Date: Aug 2006
Location: San Diego, CA
|
I have a different Excel question and instead of starting a new thread I figured I'd threadjack here for a minute:
I have an excel sheet which I'd like to have a cell where I'd input a letter and then have that letter generate a pre-written response into another cell. I can do this with simple letters being counted across a row or whatever, but I want literally one letter to represent a pre-written statement: John Smith - A (Spelling errors) or something along those lines. |
03-17-2010, 02:13 PM | #7 | |
College Starter
Join Date: Dec 2006
|
Quote:
So you want to have (for example) cell A1 as "John Smith", cell B1 as [enter a letter], and cell C1 as [pre-written text] ? If so...use VLOOKUP. Like this (in cell C1): =VLOOKUP(B1, [2x2 Range of cells], 2, FALSE) EDIT to add: Make sure your letters are furthest to the left in your 2x2 range of cells. Last edited by SteveMax58 : 03-17-2010 at 02:15 PM. |
|
03-17-2010, 02:45 PM | #8 | |
College Prospect
Join Date: Nov 2006
Location: High and outside
|
Quote:
Yeah, SUMPRODUCT can be very confusing. It's just a way to get an array of values to multiply times an array of whether to USE those values. So you need an array of all the values in cell A2 of all the sheets and an array of 1's and 0's signalling which of those values to use. SUM the PRODUCT of those two arrays and you effectively have a SUMIF across sheets. Anyway, I attached a sample worksheet using method 1. I put values in cell A6 of 3 sheets. My criteria for whether to sum them is in D2 ("> 0"). The formula is in A1. Oh, and the list of sheet names is in cells G6:G8 and is a named range called "SheetList". Hope it helps. Last edited by Bobble : 03-17-2010 at 02:49 PM. |
|
03-17-2010, 03:00 PM | #9 | |
Coordinator
Join Date: Oct 2000
Location: Big Ten Country
|
Quote:
I think I get it. The thing is, I need to take the info from the 40 tabs I already have and put it in 11 new tabs. Would I then need 11 different ranges, one for each tab? The good news is, though, that I managed to get everything I needed by going to the tabs that my initial 40 tabs were pulling from, so the problem is solved! |
|
03-17-2010, 03:01 PM | #10 | |
College Prospect
Join Date: Aug 2006
Location: San Diego, CA
|
Quote:
Still lost, sorry! Joe Smith 1 Student struggling with spelling concepts How would I make it so that cell 1C, when a "1" is entered in cell 1B, says "Student struggling with spelling concepts" |
|
03-17-2010, 03:05 PM | #11 | |
College Prospect
Join Date: Nov 2006
Location: High and outside
|
Quote:
Is it different "SUMIF" criteria for the 11 tabs? Then you're just looking at a seperate SUMPRODUCT statement for each tab. If I want to sum every value greater than 7 from the 40 tabs and put that on Tab1, then Tab1 would just have the SUMPRODUCT formula in cell A1 with a criteria of "> 7" in cell D2. If you wanted to sum every value less than 3 and put that on Tab2, then Tab2 would have the SUMPRODUCT formula in it's A1 and a criteria of "< 3" in it's D2. Or, am I not understanding? Last edited by Bobble : 03-17-2010 at 03:06 PM. |
|
03-17-2010, 03:07 PM | #12 |
Coordinator
Join Date: Oct 2000
Location: Big Ten Country
|
Mike --
Take one of your tabs, and call it 'key' In that tab, in Column A, put the numbers. In Column B, put the corresponding messages. So Cell A1 will say "1" and Cell B1 will say "Student struggling with spelling concepts" In another tab, use column A to enter your numbers, and in Cell B1, paste this formula: =VLOOKUP(A1,key!$A:$B,2,0) Then copy Cell B1, and paste it down for all the new numbers you've typed into Column A. |
03-17-2010, 03:12 PM | #13 | |
College Prospect
Join Date: Nov 2006
Location: High and outside
|
Quote:
You have a table in two columns, say, cells D1:E3 that looks like this: D | E 1 | Student struggling 2 | Student stinks 3 | Student slow on the uptake Then in cell C1 you put that vlookup formula =vlookup(B1, D1:E3, 2). Its telling excel to look up the value in B1, find that value on the table in D1 : E3, and print out the value in the second column of that table. In this case it looks at B1 and finds a 1. It goes to the table, finds 1 and then looks across to the second column and would return back with "Student struggling". |
|
03-17-2010, 03:14 PM | #14 | |
Coordinator
Join Date: Oct 2000
Location: Big Ten Country
|
Quote:
No, this was exactly right. Thanks! |
|
03-17-2010, 03:30 PM | #16 |
Coordinator
Join Date: Oct 2000
Location: Big Ten Country
|
Oh, with one caveat -- I wasn't able to copy and paste that cell all over the tab, so I used the address function, and ended up with a formula like this: =SUMPRODUCT(SUMIF(INDIRECT("'"&SheetList&"'!$A$2"),$A$2,INDIRECT(ADDRESS(ROW(B14),COLUMN(B14),,,""&SheetList&"")))) |
03-17-2010, 03:32 PM | #17 | |
College Prospect
Join Date: Nov 2006
Location: High and outside
|
Quote:
Hmm, I've never used ADDRESS myself. You learn something new every day... |
|
03-17-2010, 03:35 PM | #18 |
Coordinator
Join Date: Oct 2000
Location: Big Ten Country
|
Glad I could return the favor!
|
03-17-2010, 04:47 PM | #19 |
College Starter
Join Date: Dec 2006
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|