Excel : Automate value generation in excel - excel

Generate value P in 5 different cells when I have value 5 input in a different cell
Example A1 has value 5
B1 to b5 cells should generate value P in those 5 cells
If I change value of A1 to 7
it should generate P in b1 to b7

Related

Add cells value until specific number is reached in Excel

Example:
Cell A1 has a value of 7
Cell B1 has a value of 4
Cell C1 has a value of 3
Cell D1 has a value of 5
Cell E1 has a value of 6
Excel function should add values until my specific value (15) or nearest to or less then to 15 is reached and return answer in a cell. For example excel should return value of 14 after adding Cell A1, B1 and C1. Excell should stop adding values at this point and should start adding the other cells until the 15 threshold and return value in new cell.
Can this be achieved?

How to update the contents of one cell based on the contents inputted inside another cell?

I want a cell to automatically update when the contents in another cell are changed so that the data in both the cells fit a function. For example I have some data in B2 and some other data in B3, I want there to be a kind of restrain of B2+B3 = 29. Suppose that B2 has a data of value x and B3 has a data of value y,so if I change B1 from say x to x+7, then the data in B2 should go from y to y-7.
You can make this constraint easily if you only need to input into B2 and never manually write into B3:
A
B
C
1
2
20
3
=29-B2
If you need to manually enter values into both B2 and B3 you could set up a validating function:
A
B
C
1
2
20
3
9
4
=If(B2+B3=29,"","B2 and B3 must sum to 29!")
You could also set up a conditional formatting rule to highlight invalid selections.
To automatically enter the other value to keep the total 29, you'd need VBA.

Would like to combine two columns of data, one has blank rows, other is continuous

I have two columns of data in excel: A & B. The first column (A) has zeros and blank cells. The second column (B) has numbers. I would like to make a third column (C) that enters the numbers from column two sequentially into the blank spaces from the first column.
I was thinking i could use: =if(A1="",B1, A1) but that obviously will be wrong if the first blank is at A3 since B3 will be entered.
I think i need a command to move down the B1 column only if it gets entered into A.
A B C
1. 0 24 0
2. 0 13 0
3. 41 24
4. 62 13
5. 0 6 0
This is an interesting question.
Try this....and please don't forget to accept the solution if it works for you. I am trying to increase my reputation here since I am new to StackOverflow. Thanks!
Assuming Excel Sheet looks like following:
Cell A1 = 0 Cell B1 = 24
Cell A2 = 0 Cell B2 = 13
Cell A3 = Cell B3 = 41
Cell A4 = Cell B4 = 62
Cell A5 = 0 Cell B5 = 6
Type this in cell C1:
=IF(A1="",INDEX($B$1:$B$5,SUM(($A$1:A1="")*(1))),"")
make sure to push control-shift-enter when submitting the formula in cell C1 since it is an array formula. You should then be able to copy it (control-c) and paste it down the remaining rows (control-v)

Comparing 2 ranges of values to a single cell

I want to compare 2 ranges of values to a single cell. I want to compare each row of both columns combined. Not just any value in column A and any in column B. It must be A1 & B1, A2 & B2, etc.
Example:
A1 : 1
A2 : 5
A3 : 7
B1 : 2
B2 : 3
B3 : 6
C1 : 11
I could use this formula:
=IF(OR(AND(A1<C1,B1>C1),AND(A2<C1,B2>C1),AND(A3<C1,B3>C1)),0,C1)
But I need to check a range of more than 100 cells so using AND would bloat the formula.
Which formula do I use?
Thanks in advance.
use COUNTIF():
=IF(COUNTIFS(A:A,"<"& C1,B:B,">" & C1),0,C1)
If any fit then it returns 0 other wise C1

Comparing values of a range of cells to a single cell's value

I want to compare values of a range of cells to a single cell's value. I want to know if any cell's value of the range is smaller.
Example:
A1 : 1
A2 : 5
A3 : 7
A4 : 9
B1 : 2
I could use this formula:
=IF(OR(A1<B1,A2<B1,A3<B1,A4<B1),0,B1)
It does what I need. But I'm looking for a more elegant and practical formula than OR because I need to check a range of more than 100 cells.
Which formula do I use?
Thanks in advance.
EDIT: COUNTIF worked fine but now I want to compare a range of values in the same row of 2 columns to a single cell.
Example:
A1 : 1
A2 : 5
A3 : 7
B1 : 2
B2 : 3
B3 : 6
C1 : 11
=IF(OR(AND(A1<C1,B1>C1),AND(A2<C1,B2>C1),AND(A3<C1,B3>C1)),0,C1)
COUNTIF just checks if any cell within and the range is smaller or larger. It doesn't match the rows though.
You can calculate the minimum value of column A in a cell and compare it to value in B1.
=IF(MIN(A1:A4)<B1,0,B1)

Resources