Excel How to insert value based on todays date - excel-formula

I have 4 columns in excel. Date, Apple, Banana and Oranges. I have a different sheet where I have a header called "Today's Production" Under the header I have Banana, Apple and Oranges listed. How do I populate these fields
Screenshot added

If the first cell of your table were in A1, for the bananas column, you can just use something along the lines of
=SUMIFS(B1:B10,A1:A10,TODAY())
Then for apples, you would adjust your B column to C, and for oranges, adjust B to D

Related

Stacking two list of data on top of each other in excel

I have two excel sheets with one column each.
Sheet1
A
Fruits
Orange
Apple
Grapes
Sheet2
B
Vegetables
Tomatoes
Potatoes
Now, how do I use excel formula and populate on a third sheet stacking just the values
A
Orange
Apple
Grapes
Tomatoes
Potatoes
If your data has a header in Sheet1!A1 and Sheet2!A1 then in Sheet3!A1 you could use (and drag down):
=IF(ROW()<=ROWS(Sheet1!$A$2:$A$4),
Sheet1!A2,
SUBSTITUTE(
INDEX(Sheet2!A:A,
ROW()-ROWS(Sheet1!$A$2:$A$4)+1),
"",""))
If the row number in the new sheet is smaller than or equal to the count of rows in the range of Sheet1 then the result is Sheet1!A2:A4 if the row is greater it'll index Sheet2 column A and will get the result for in that range with the row that equals to the current row number minus the total count of rows of Sheet1!A2:A4 + 1 to take the header into account.
In Office 365 a simple =HSTACK(Sheet1!A2:A4,Sheet2!A2:A3) would do.

Excel: Grouping and restructuring data in Excel

In Excel, I want to convert the table on the top (Initial data) into the one at the bottom (Desired output).
I want to group the items in the second row by the first row, and then generate one column per unique value of the first row and list the items of the corresponding group in that column.
Is there a way to do that without manually copying cells?
Table: Initial data
Fruit
Banana
Fruit
Apple
Fruit
Grape
Vegetable
Spinach
Vegetable
Eggplant
Table: Desired output
Fruit
Vegetable
Banane
Spinach
Apple
Eggplant
Grape
If you have access to the UNIQUE and FILTER functions (Excel 365), you could accomplish this as follows.
Assuming your data is in A1:B5. In D1 enter:
=TRANSPOSE(UNIQUE($A$1:$A$5))
This will get you the unique values from the cells in A in D1:E1. Then in D2 enter:
=FILTER($B$1:$B$5,$A$1:$A$5=D1)
And drag to the right.
I.e. you do this:
Result:

How do I highlight a cell in Excel when all its content is contained in another column

I have a column (column A) that contains a list of text and another column (column B) that contains a smaller list, which is the values that I actually care about. Is it possible to only highlight cells in column A if all of its contents is listed in column B? If so, how?
A B
Apple Apple
Peach Pear
Apple, Pear Plum
Apple, Grape Kiwi
Apple, Pear, Kiwi      
Watermelon, Grape
So in the above example, I would like to highlight A1, A3, and A5 because all of the contents is listed somewhere in column B
use the following formula for the Conditional formatting:
=AND(ISNUMBER(MATCH(FILTERXML("<a><b>"&SUBSTITUTE($A1,",","</b><b>")&"</b></a>","//b"),$B:$B,0)))
If one does not have FILTERXML then they can use:
=SUMPRODUCT(--ISNUMBER(SEARCH("," &$B$1:$B$4&",",","&SUBSTITUTE(A1," ","")&",")))=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1
Noting that the range $B$1:$B$4 must be the size of the lookup values without any blanks

Excel - Find if a product changed price

How can I find if a product changed it's price in excel? For example:
Yesterday's prices:
Potatoes 5,50
Tomatoes 7.40
Apples 5.60
Cucumber 4.30
Today's prices:
Potatoes 5,50
Tomatoes 5.20
Apples 5.50
Cucumber 4.30
Tomatoes and apples changed their price. How is it possible to highlight those changes based on "A" column product description?
This formula will return TRUE if an item in the list has changed price:
=COUNTIFS($A$1:$A$8,A1,$B$1:$B$8,"<>"&B1)>0
Enter it in C1 (in this example) and drag down
Here is what you can try. I also attached some pics for your reference.
Columns A and B are for yesterday's prices, columns C and D are for today's prices, and column E is to see the price changes (you don't need column E but I just want to show you so you know what is happening). Also, the formula for column E is =INDEX($A$3:$B$7,MATCH($C3,$A$3:$A$7,0),2)-$D3.
To highlight whichever product had price changed. We will use Conditional Formatting which is under Home > Conditional Formatting > New Rule > Use a formula.... Under cell D3, you enter the same formula like in cell E3 which is =INDEX($A$3:$B$7,MATCH($C3,$A$3:$A$7,0),2)-$D3. Pick the color you want as the pic sample below.
Then applies to =$D$3:$D$6 just like the pic shows below.
This should work for you. Try and let me know.
Use the conditional formatting on another column. E.g. have a column of Yesterday-Today and highlight if <> 0.
This will work, use the formula
=IF((AND(A1=C1,B1<>D1)),"yes","no")
where A1, C1 have fruite and B1, D1 have prices.
Below is the result obtained.
Potatoes 5,50 Potatoes 5,50 no
Tomatoes 7.4 Tomatoes 5.2 yes
Apples 5.6 Apples 5.5 yes
Cucumber 4.3 Cucumber 4.3 no
Then you can filter/highlight based on whether it is a yes/no.

MIN function in Excel

I need to find minimums in a list of companies and prices. For example in one column I have apples, pears and grapes. For each of these there are several sellers and each of them has a different price. The list in the A coulmn would be Apple, Apple, Apple, Grapes, Grapes, Pear, Pear, Pear, Pear. In B would be Target, Trader Joe's, Harris Teeter etc... And in column C would be the price. Fruits in column A are in alphabetical order. I need to find a separate minimum for every fruit. I can do that manually except I have thousands of rows of data.
I'm thinking along the lines that I need to specify the area in which I want to return the minimum from. That would be as long as the entity in column A is the same, that's the area.
Does anyone know a solution for this problem?
If data starts at row 2 (headers in row 1) try this formula in D2 copied down
=IF(A2=A1,"",MIN(OFFSET(C2,0,0,COUNTIF(A:A,A2))))
That will give you the minimum price on the first row of each fruit. Filter column D on non-blanks to see just the minimums
Use a combination of IF and MIN
=MIN( IF ( logical_test, value_if_true, value_if_false ) )
e.g.
=MIN( IF ( A2:A100="Apple", B2:B100, 0 ) )
You can use PivotTables:
Select your data and insert a PivotTable:
Choose a location to put it. I'll put it in the same sheet:
Click, drag and drop the fruits under Row Label and the Price under Row Values:
Right click on the PivotTable and pick Summarise by > Minimum:
And you should end up with this:

Resources