Sum the values that are in the same columns in excel - excel

I want to sum the values that are in the "Time" columns but return 0
I tried the following formula:
=SUMIF(C2:H2,"Time*",C3:H3)
=SUMIF(SCRATCH031342[#Headers],"Time*",C3:H3)

Sum Up Numbers As Text
For the first row of data, you could use
=SUMPRODUCT(--(LEFT(C$2:H$2,4)="Time"),VALUE(C3:H3))
or
=SUMPRODUCT(--(LEFT(SCRATCH031342[#Headers],4)="Time"),VALUE(C3:H3))
and copy down.
Additionally, if you'll write the results in the same row as the table row (e.g. in cell J3), you should simplify the table version with:
=SUMPRODUCT(--(LEFT(SCRATCH031342[#Headers],4)="Time"),VALUE(SCRATCH031342[#]))

You can use:
=SUM(INDEX(C3:H4,0,MATCH(C6,C2:H2,0)))
and fill in cell C6 with the desired column name

Related

Excel CONCAT columns B and C while they have similar values at column A

How can I CONCAT two columns values while the column A has similar values in each rows in Excel?
Something like following, what I need is to CONCAT values of rows in Columns B and C while the A is similar:
Assuming you are on Excel 365 and have use of FILTER() and TEXTJOIN(), you can enter the following formula into column D and drag down:
=IF(COUNTIF($A$1:A1,A1)=1,TEXTJOIN(":",TRUE,FILTER($B$1:$C$15,$A$1:$A$15=A1)),"")
This checks if the value in column A is the first occurrence of that value. If it is, it will output a colon delimited string of every value in columns B:C where col A equals the current value in column A.
you can use if command
if cellA1<>cellA2 then you concatenate b2 and C2
else you concatenate D2 and B2, and C2.
You can use a helper column to do this but you need to have a header row for this to work. Assuming your first row of data is in A2, B2, C2:
paste this into D2:
=IF(A2=A1,D1&","""&B2&""":"""&C2&"""",""""&B2&""":"""&C2&"""")
and paste this into E2:
=IF(A2=A3,"",D2)
Copy these two down to every row in the data.
Note: This version puts the concatenated result in D at the last row of the group instead of at the first row of the group like your screenshot shows.

Excel 2016: adding number values in a row from cells with text and numbers

I need to add number values in a row where cells contain text and numbers; like "P1" or "S7" where I need to add the 1 and 7 into a total column.
I can extract the number values from individual cells using =RIGHT(V3,SEARCH("P",V3))+0, but can't figure out how to do that easily for row of 32 cells.
Example:
For example to sum D1 through G1, use:
=SUMPRODUCT(--MID(D1:G1,2,9999))
As you see, this formula discards the lead text character in each cell.
EDIT#1:
To add cells beginning with P or S only, use:
=SUMPRODUCT(--MID(D1:G1,2,9999)*(LEFT(D1:G1,1)="P")) + SUMPRODUCT(--MID(D1:G1,2,9999)*(LEFT(D1:G1,1)="S"))
You can place your formula on the first column of your row. Then when you copy the formula across your columns it will automatically reference the cell offset the same as V3 is offset from each other cell with formula.

Sum a column and put the sum on top of column for dynamic number of rows

Is there any way to put the sum of a column values on the top of same column.
For ex: I want to add the values on column A and put the total in the cell A1 and number of rows on column A is dynamic.
In A1 enter:
=SUM(A2:A1048576)
For versions of Excel 2007 and later.

Combining data in excel

Dears,
I have 4 columns in excel.
Each row have two values but also it is mapped to another row.
I'd like to sum the values from these the rows that are mapped and delete the extra rows.
Example attached: Row A has two values but also mapped to Row C. I want to add the values in Row A with the ones in Row C and keep Row A and delete Row C
Is it possible to use formulas instead of VBA as I don't have experience in VBA?
Please advise.
Assuming your Keyword data starts with A2 and Value 1 starts with B2 and Value 2 starts with C2. (Please refer the snap below)
Apply the below formula in H2 for Value 1 summing and drag down
=IF(VLOOKUP(G2,$A$2:$D$4,4,FALSE)=0,VLOOKUP(G2,$A$2:$D$4,2,FALSE),VLOOKUP(G2,$A$2:$D$4,2,FALSE)+VLOOKUP(VLOOKUP(G2,$A$2:$D$4,4,FALSE),$A$2:$D$4,2,FALSE))
Apply the below formula in I2 for Value 2 summing and drag down
=IF(VLOOKUP(G2,$A$2:$D$4,4,FALSE)=0,VLOOKUP(G2,$A$2:$D$4,3,FALSE),VLOOKUP(G2,$A$2:$D$4,3,FALSE)+VLOOKUP(VLOOKUP(G2,$A$2:$D$4,4,FALSE),$A$2:$D$4,3,FALSE))
EDIT #1 If G value does not contain in Table 1 then apply the below formula
in H2
=IF(ISERROR(IF(VLOOKUP(G2,$A$2:$D$4,4,FALSE)=0,VLOOKUP(G2,$A$2:$D$4,2,FALSE),VLOOKUP(G2,$A$2:$D$4,2,FALSE)+VLOOKUP(VLOOKUP(G2,$A$2:$D$4,4,FALSE),$A$2:$D$4,2,FALSE))),"Not Found in Table",IF(VLOOKUP(G2,$A$2:$D$4,4,FALSE)=0,VLOOKUP(G2,$A$2:$D$4,2,FALSE),VLOOKUP(G2,$A$2:$D$4,2,FALSE)+VLOOKUP(VLOOKUP(G2,$A$2:$D$4,4,FALSE),$A$2:$D$4,2,FALSE)))
in I2
=IF(ISERROR(IF(VLOOKUP(G2,$A$2:$D$4,4,FALSE)=0,VLOOKUP(G2,$A$2:$D$4,3,FALSE),VLOOKUP(G2,$A$2:$D$4,3,FALSE)+VLOOKUP(VLOOKUP(G2,$A$2:$D$4,4,FALSE),$A$2:$D$4,3,FALSE))),"Not Found in Table",IF(VLOOKUP(G2,$A$2:$D$4,4,FALSE)=0,VLOOKUP(G2,$A$2:$D$4,3,FALSE),VLOOKUP(G2,$A$2:$D$4,3,FALSE)+VLOOKUP(VLOOKUP(G2,$A$2:$D$4,4,FALSE),$A$2:$D$4,3,FALSE)))

Return the row number if value is between two values in excel

If I have a lookup table with a range of number (Min and Max) in two columns. ON the second sheet, it contains the numbers (1-100). And I'd like to lookup the row number from the lookup table. How can I do?
Consider:
=INDEX(A$2:A$11,MATCH(D2,B$2:B$11,1))
Assuming that Band is in the A-Column, Min in the B-Column and so on and the headers in the first row, put this in F2 and drag down as necessary:
{=INDEX($A$2:$A$11,MATCH(1,(E2<=$C$2:$C$11)*(E2>=$B$2:$B$11),0))}
Please note that you don't have to put in the {}, this indicates, that this is a array formula, so you have to enter this formula with Ctrl+Shift+Enter instead of just Enter.
If you have the data in different ranges, then you will have to adjust the ranges accordingly.
If you are interested in the row instead of the Band, then wrap ROW arround the formula, so:
{=ROW(INDEX($A$2:$A$11,MATCH(1,(E2<=$C$2:$C$11)*(E2>=$B$2:$B$11),0)))}
Again with Ctrl+Shift+Enter.
You can use index match.
Give the lookup table a name, for example "tbl"
Lets say numbers are in column G
Then you can use this formula:
=INDEX(tbl[band];MATCH(1;(G11>=tbl[min]) * (G11 < tbl[max]);0))
Tables
Formula
Reference:https://exceljet.net/formula/index-and-match-with-multiple-criteria

Resources