copy cell to selected date range - excel

I have a list of dates in B2:GF2. I enter 2 dates - "A1 start date and B1 End date". I also enter a value (number) in cell C1. The value in C1 should be copied to all the cells under the list of dates from A2:GF2 between the dates choosed in A1 and B1. Let the copied value between the row A3:GF3.
E.g.:
A | B | C
Row1 3/3/2015| 5/5/2015 | ABC
Row2 2/2/2015 | 3/3/2015 | 4/4/2015 | 4/23/2015 | 5/5/2015....
ABC ABC ABC ABC

In cell C4, type =IF(AND(C3>=$A$2,C3<$B$2),$C$2,""), then just copy cell C4 across.

Related

Increment row reference based on index in selection, and not same row number between sheets

I have a workbook containing two sheets. Sheet 1 has values in column A for every row up to row number 2000. Sheet 2 should duplicate the values over multiple rows for each row in Sheet 1. Like this:
Sheet1:
a1 | 123
a2 | 456
a3 | 789
and for Sheet2:
Sheet2:
a1 | 123
a2 | 123
a3 | 456
a4 | 456
a5 | 789
a6 | 789
The duplication is fairly simple, where I just put a reference of the next rows to the row collecting the row value from Sheet1:
a2: =a1
However, selecting and dragging rows a1 and a2 in Sheet2 to get the corresponding formulas copied over to the next rows, the formula does not reference the correct rows in Sheet1. Something like this occurs:
Sheet2:
a1 | 123
a2 | 123
a3 | 789
a4 | 789
Where cell a3 in Sheet2 references cell a3 in Sheet1, instead of cell a2 which is the next row. I have tried several functions with index, offset etc. but none of them seem to circumvent the automatic same-row-reference between the worksheets. Any quick ideas?
"generic approach" imho is either one of these.. :
Just edit the "2" in the 1st comment ans.
use ROW() and argument for OFFSET()
'Manually' build the reference using INDIRECT
set the 1st 2 row manually, 3rd row onward use =IF(A2=A1,INDIRECT("Sheet1!A"&(row()+1)/2,TRUE),A2) and drag downwards.
Is this what you are looking for?

How to change column to header in excel?

a1 | b1 | 0.1
a1 | b2 | 0.2
a2 | b1 | 0.3
a2 | b2 | 0.4
how to transform this table to
xx | a1 | a2
b1 | 0.1 | 0.3
b2 | 0.2 | 0.4
Make use of Pivot tables. Enter Column A as Column labels, Column B as Row Labels and Column C as Values. If values are not sum by default, change it to Sum.
Output:
You can remove the headers deselecting the Field Headers in Options tab.
You can also hide the grand totals by clicking on Options under the same tab. (Located at the left corner of the screen).
If you don't want Grand Total and other..., you can use Index:
Create a New Sheet with your Header xx, a1, a2
Copy column B b1, b2,...to the new sheet under xx
select the Data b1, b2,... in the new sheet
Remove Duplicates
Distinct and unique values will remain
Under a1 write the following formula:
=IFERROR(INDEX(Sheet1!$C$1:$C$4,MATCH(B$1&$A2,Sheet1!$A$1:$A$4&Sheet1!$B$1:$B$4,0)),"")
Array Formula press Ctrl+Shift+Enter at the same time instead of Enter
and drag it in the same row and down in columns
Change A1:A4, B1:B4 and C1:C4 to correspond your last row of Data but keep $ for fixed references

Add A1 to C1 if B1 = Specific Number

I will try to be as clear and concise as possible. I am working on a spreadsheet in which I have item prices listed in a range of A1:A40. B1:B40 lists a numerical digit (either 1, 2, 3, etc.) that corresponds with a purchase category type (groceries, gas, etc.). Now I want one cell, such as C1, to add all instances in the A range that equal a specific number in B.
For example:
A1 = $5.00 | B1 = 1 | C1 = The sum in range A1:A3 if it's corresponding B value is equal to 1 (In this case B1 and B3, so C1=A1+A3)
A2 = $2.50 | B2 = 2 | C2 = The sum in range A1:A3 if it's corresponding B value is equal to 2 (In this case B2, so C2= B2)
A3 = $4.00 | B3 = 1 | C3 =
Use SUMIF Function
SUMIF(range, criteria, [sum_range])
In Cell C1 enter the formula = SUMIF(B:B,1,A:A)

Sum fields in a column if there is an entry in a corresponding row in another column

Assume the following data:
| A B C
--+------------------------
1 | 2 3 5
2 | 2 3
3 | 4 4
4 | 2 3
5 | 5 6
In cell A6, I want Excel to add cells C1, C2, C3 on the basis that A1, A2 and A3 have data in. Similarly, I want B6 to add together C1, C4 and C5 because B1, B4 and B5 have data.
Can someone help?
In A6 enter:
=SUMPRODUCT(($C1:$C5)*(A1:A5<>""))
and then copy to B6:
A simple SUMIF formula will work
=SUMIF(A$1:A$5,"<>",$C$1:$C$5)
Place that formula is cell A6 and then copy it to B6.
You can create another column, e.g. AValue, with the formula =IF(ISBLANK(A1),0,A1) in it. This will return 0 if the cell in A in the corresponding line is empty, or the value from the cell in A otherwise.
Then you can just sum up the values of the new column.

Excel: Given a cell in column B as input, how could I find out the lowest cell of A which B > A?

I have an excel sheet, which value of column A >= B in the same row.
I would like to know given a cell in column B, how could I find out the lowest cell of A which B > A? (It should return a cell address but not the value)
For example, the following shows cells from A1 to B7 in a sheet:
A B
------
1 | 1 1
2 | 3 2
3 | 5 3
4 | 7 4
5 | 9 5
6 | 10 6
7 | 15 10
Now I would like to input B6, then it should return A3 (since 6 > 5)
Another example, if I input B7, then it should return A5 (since 10 > 9)
Is there any approach (or similar approach) by using excel formula? Or should I use other methods?
If your input value is in cell E1, and your return value is in cell E2 (as shown in below image), then you can use this formula in cell E2:
=IF(E1="","",INDEX(A1:A7,MAX(1,MATCH(TRUE,INDEX(A1:A7>=E1,),0)-1)))
Input Cell E1 (enter the address from column B here)
F1: =ADDRESS(LOOKUP(2,1/(INDIRECT(E1)>ColA),ROW(ColA)),1,4)
Given your data, if you enter B6 in E1, A3 will show in F1

Resources