Using ratios n Excell without reducing - excellibrary

Is it possible to convert A and B to ratio in excel, but not reduce it? It is for a employee to kids ratio in a daycare. 12 kids and 3 kids would be entered 12 in A and 3 in B to show 12:3. I just don't want it reduced to 4:1, Thanks!

If I understand you correctly, you have 12 in one cell, and 3 in another, and wish to display them in a third cell as a ratio: 12:3.
In that case, this is how it's done:
Say you have the 12 in cell A1 and the 3 in cell B1, and you wish to display the ratio in cell C1. To do this, click on cell C1, and type in the following formula in the formula bar:
=A1&":"&B1
This instructs Excel to combine the contents of A1, a colon in double quotes, and the contents of cell B1, into cell C1.
Bilal

Related

Get the corresponding non-empty adjacent cell in a column in Google Sheets

I'm trying to find the formula for column "C" in order to obtain this:
A
B
C
1
blue
flower
blue
2
water
blue
3
sky
blue
4
green
grass
green
5
frog
green
6
yellow
lemon
yellow
7
sun
yellow
I've tried with INDEX and MATCH but I haven't found yet the way to go.
Bonus: a unique formula with ARRAYFORMULA would be very nice for my use case.
Given the exact layout and ranges shown in your post, delete everything from Col C and place this array formula in C1:
=ArrayFormula(IF(B2:B="",,VLOOKUP(ROW(A:A),FILTER({ROW(A:A),A:A},A:A<>""),2,TRUE)))
This will lookup each row number for rows where Col B is not empty within a virtual array of only those row numbers where Col A is not empty paired with the value of Col A, and return the result from the second column of that array. Because the final parameter of VLOOKUP is TRUE, any exact row number searched and not present in the limited virtual array will "fall backward" to the last row number that was occupied.
I guess you are looking for this
=ArrayFormula(if(row(A1:A) <= max(if(not(isblank(B1:B)), row(A1:A))),vlookup(row(A1:A),filter({row(A1:A),A1:A},len(A1:A)),2),))
Another way
=ArrayFormula(if(B2:B="",,lookup(row(A2:A),row(A2:A)/if(A2:A<>"",1,0),A2:A)))

Adding the first digit(s) of a cell ending with specific letter

I have a sheet that has blocks of cells. I add them for a total if they don't contain any letter. Letters signify a specific variable or signifier code for tracking. I also want to add the cell value when a cell has an ending code letter. I've tried SUMIF, Substitute, SumProduct and a few others.
For a while I've used the following which worked till the S value changed to another number than "8" which then gave the wrong sum from the range.
=if(countif(D64:Q64,"*S")=0,"",((countif(D64:Q64,"*S"))*8))
In the cell range I have 5 variable groups ending in a letter (A, H, S, C and R) and one group not ending in any letter.
The formula I use to add the cells not containing a letter but have a value is this
=IF(SUM(AA64,(SUMIF(D65:Q65,"<>")),-(COUNTIF(D65:Q65,">=0")*8))>24,24,(SUM(AA64,(SUMIF(D65:Q65,"<>")),-(COUNTIF(D65:Q65,">=0")*8))))
which adds the table data plus the previous lines table data but does not exceed 24.
H is a set value of 6 and doesn't change.
Does anyone know how to add the value of the cells that contain a specific letter?
N (number)
A
S
C
R
H
8.5
H
8A
2S
9
3C
0.5R
17.5
8
2
3
0.5
6
I'd prefer it be a formula usable in Google Sheets because that is where this data is.
Solution:
You can use this formula below column "N" then drag right until below column "H".
=SWITCH(H$1,"N",SUM($A2:$G2),"H",6,SUM(IFERROR(ARRAYFORMULA(VALUE(LEFT($A2:$G2,FIND(H$1,$A2:$G2)-1))),0)))
This is a combination of three formulas:
If the row above is N, sum A2 to G2. This will ignore all the strings.
If the row above is H, output 6.
Else, get the number to the left of the defined suffix, set all others to 0, and get the sum.
Output:
References:
Extract number from string in Google Sheets
An alternative could be to use
=SUMPRODUCT(A3:G3, isnumber(A3:G3))
to compute the sum of the cells with numbers only, and to use
=sum(filter(substitute($A$3:$G$3, I$2,)+0, regexmatch($A$3:$G$3, I$2)))
under the 'A' and drag to the right
Examples

Change the colour of a cell based on another cell value

I am trying to create a pixel art activity where a specific number in a cell will turn a different cell a colour if the correct answer/ number is input.
For example if cell C2 has the correct answer of 7 then cells E1,F2, and G3 would turn Red.
Then if cell 2 has the correct answer of 22 cells F1,G2, and E3 would turn blue. But any other number would not change the colour of those cells.
try like this with custom formula:
=$C$2=7
welcome to stackoverflow.
For example in cell C2 apply this rule
Format cells if: 'Custom Formula is' (dropdown)
= E1 = 7
now C2 should get formatting when E1 equals 7.
Note that for strings you will need to use double quotes, like this:
= G2 = "k"
Finally, if multiple cells need the same rule, you can click the squares icon in the 'Apply to range' input field, and then you can hold 'control' and click multiple fields.

Excel formula to return the number of occurrence of a string in a column

I have a Column "Name" as follows and I would like to find the occurrence of a value in the same column in the adjacent Column "Occurrence" as follows: Column "Occurrence" should show the Occurrence of the String next to it till that row
Name Occurrence
Alpha 1
Bravo 1
Alpha 2
Alpha 3
Charlie 1
Charlie 2
Golf 1
Golf 2
Golf 3
Hotel 1
I tried solving this but couldn't succeed, is there is a way to write a formula in column "Occurrence"?
Formulas can be fixed or mutable, or mixed, which is what you want.
The formula should reference the start of the list as a fixed point, but have the end of the list as changable. The $sign is used to tell Excel that a formula used a fixed reference, which will not change when you copy or fill the formula to other cells.
If Name is cell A1 and Occurrence is cell B1
B1 formula = COUNTIF($A$2:A2,A2)
Drag formula down.
The start of the list, $A$2, will stay the same as you copy the formula down. The other two parts will change the row number.

A "constant" in google spreadsheet?

Say I have 2 columns: (this is extremely simplified)
Data = a number
Result = Data * 1.2
I can put B2 = A2*1.2, then drag and drop B2 down...
and it fills all the other cells, which is perfect.
But can I put this multiplier (1.2) somewhere as a "constant"? (for clarity and being easily editable)
Say I put it in E1, and set B2 = A2*E1.
Now I can't drag and drop anymore (because E1 becomes E2 E3 and so on)
In this example, is there a way to make E1 stay as you drag it down?
Short answer
Use an absolute cell reference or a named range
Explanation
Instead of E1, which is a relative cell reference, use $E$1 which is an absolute cell reference.
An alternative is to to assign a name to the cell E1, let say, "constant"
In the first case the formula will be
=A2*$E$1
In the second case
=A2*constant
References
Spreadsheet - Wikipedia
Name a range of cells - Google Docs Editors Help
I understand that you are asking for "A “constant” in Google spreadsheet?" and later on a "drag down" solution.
You can use the accepted answer, OR ...
Instead of having to drag down (increasing the number of formulas)
Use a single formula in B2
=ArrayFormula(A2:A6*E1)
You can even use it for future entries or now blank cells.
=ArrayFormula(IF(A2:A11<>"",A2:A11*E1,""))
How the formula works
The ArrayFormula will apply the calculation cell*E1 in every single row, IF the cell is not empty/blank "".
IF it is a blank cell it will return a blank cell "".
Functions used:
ArrayFormula
IF
Can you try this in your formula?
Cell B2 type
=A2*$E$1
Then there is no need to drag it down on column E, it will all follow E1.
I believe this solves the problem.
If you really want to drag it down, then why not just put Cell E2
=E1
So that even when you drag, the value will remain 1.2

Resources