How do I sum from whats in B2 to C2 ?
B2 = A10 or just 10 (preferred)
C2 = A25 or just 25 (preferred)
Normally you would just use SUM(A10:A25), but the values in B2 and C2 are not fixed, they change based on input.
I can use MATCH to find the numbers, but how do I tell SUM to use those numbers ?
The values to sum are always in the same column.
You can use the INDIRECT function for this, e.g.
=SUM(INDIRECT(B2):INDIRECT(C2))
if you can live with entering the entire cell name (A10, A25).
Or to just have the numbers in B2 and C2, you could use
=SUM(INDIRECT(ADDRESS(B2;1)):INDIRECT(ADDRESS(C2;1)))
(Hope I got the columns and rows in the right order!)
You want to specify Cell Co-ordinates in the value of a Cell ?
Is that what you're getting at ?
Try Setting
B1 = "A10"
C1 = "A25"
D1 = =SUM(INDIRECT(B1):INDIRECT(C1))
Use the INDIRECT() function. You pass it a string that is a range, which allows you to have a dynamic range based on input.
Related
I found something confusing in Microsoft Excel.
I fill Cell A1, A2, A3, A4 with the same number 1,
then I enter the formula = A1 = A2 = A3 = A4 on cell A5,
why do I get FALSE results?
Is there a way to find out the values of 4 cells are the same or different?
If all you are using is these numbers you could check for the standard deviation. If it's 0 then all values are equal:
=STDEV.P(A1:A4)
So a check for equality could look like:
=IF(STDEV.P(A1:A4),"Different","Equal)
You can compare the range with the first cell, include it in the AND function and enter it as an array formula.
It will process both text and numeric values.
=AND(A1:A4=A1)
Array formula after editing is confirmed by pressing ctrl + shift + enter
You can use COUNTIF.
This is how it works in this example:
The COUNTIF returns a count of any cells that do not contain "1" which is compared to zero. If the count is zero, the formula returns TRUE. If the count is anything but zero, the formula returns FALSE.
You can apply that to any value you want to compare. Just place it before the "<>" in the formula.
This also works for "strings".
I need to make a sum of 12 rows every 3 rows in excel. That is, I need to sum first from C4 to C15, then from C7 to C18, and so on.
You can use OFFSET function for this, also volatile, but shorter!
Assuming first formula in E2 copied down
=SUM(OFFSET(C$4,(ROWS(E$2:E2)-1)*3,0,12))
I prefer this because it explicitly contains all the required information
C4 = first cell to sum,
E2 = first cell with formula,
3 = row increment,
12 = number of cells to sum
The above gives you the sums on successive rows from E2 (or any other chosen cell) down. If you actually want the sum to be shown every 3 cells e.g. on the first row for each sum then that's simpler - try this formula in D4 copied down
=IF(MOD(ROWS(E$2:E2),3)=1,SUM(C4:C15),"")
.......or even easier.....just put this formula in D4
=SUM(C4:C15)
....leave D5 and D6 blank, then select the range D4:D6 and drag down
You can also use the non-volatile INDEX function
=SUM(INDEX(C:C,ROWS($1:1)*3+1):INDEX(C:C,ROWS($1:1)*3+12))
This works because INDEX returns a reference so you can use the normal Ref1:Ref2 notation for a range.
=SUM(INDIRECT("C"&ROW(1:1)*3+1&":C"&ROW(1:1)*3+12))
Be warned that INDIRECT() is a volatile formula... This means that any change made anywhere in the workbook this formula will recalculate and can cause performance issues.
Is there a way for me to set a row value from another cell value.
Example:
A1 = B62 = 'HELLO'
C1 = 62
So instead of 62 I want to set the value of C1.
A1 = B(C1) which would equal B62.
I hope I explained it well :P
Update:
This is the formula bar: =SUMIF('I1'!$C$2:$C$61,A2,'I1'!$F$2:$F$61)
Want to change the both 61 to my V4 cell value. For example if V4 = 10.
That would make =SUMIF('I1'!$C$2:$C$10,A2,'I1'!$F$2:$F$10)
Use the non volatile INDEX()
=SUMIF('I1'!C$2:INDEX('I1'!$C:$C,$V$4),A2,'I1'!F$2:INDEX('I1'!$F:$F,$V$4))
You'll want to use Indirect.
In C1, place your row value (15, for example). Then, in cell A1, use =Indirect("B" & $C$1)
Then as you change the value in C1, the value in A1 will change.
If I want to only ask excel to calculate in a cell if TWO other cells have values in them, what is the code? I know that for it to calculate only if a single cell has a value is =if(A1=0,"",B1-B2)....but how do you add criteria that two cells have a value in them?
Example where A1 and B1 are 0:
=IF(AND(A1=0,B1=0),"",B1-B2)
With this you can verify witch cell has no value
=IF(B3="",IF(C3="","both EMPTY","B3 empty C3 with value"),IF(C3="","C3 empty B3 with value","both with value"))
You can also set cell = 0 on the comparison.
Okay so I'm stumped. I'm trying to create a function that will find any letter ("c" for example) in a specified column and grab the value in the cell next to it to add into a larger sum.
Example:
A1=3, B1=c,
A2=4, B2=d,
A3=1, B3=c
should return 4
How would I achieve that in excel-like language?
Assuming you want this in Excel, type the following function in C1
=IF(B1="c", A1, 0)
Drag the cell C1 to fill the column. i.e.
C2 will be =IF(B2="c", A2, 0)
C3 will be =IF(B3="c", A3, 0) etc.
Now use summation on column C.