Excel Formula for Cell References - excel-formula

I have built a spreadsheet for stock ordering purposes, and I have a simply formula in Row 21 column U, that says IF(AC22="Delivery","Order",""). This is because the lead time is 8 months, and so I have linked it to the cell 8 months ahead. I have a number of different products with different lead times, so I have tried to find a way to have a cell that tells the formula how far ahead to look for the delivery so that I can easily update it for the different products.
Stock Ordering Picture
Any advice would be gratefully received.
Graham

Related

What formula can I use to search a value and add cells two rows over across multiple sheets?

I am trying to add values across sheets and an having a hard time finding a good formula to do this with.
I have over 300 sheets, representing rooms, that have two relevant columns, one that has dates and another with water consumption usage that look like this:
enter image description here
Issue is, the dates are inconsistent across all of the sheets. The full range of dates should be from 1/13/2023 to 2/6/2023 but many sheets are missing dates because water consumption wasn't read that date.
I have a summary page with a column representing the full range of dates and another column where I want to add usage for the specific date across all the sheets to show how much water was consumed that day across all rooms. Since the dates and usage are all in different cells, I can't call out specific cells. What is the best formula to use and how can I format it correctly?
I tried SUMIF formula's as well as IF formulas and tried nesting variations of them, but ultimately I am having trouble finding a formula/formatting that allows me to call out a cell value (ex, 2/6/2023) and sum the value two columns over. I am fairly new to the more advanced formula's so please forgive my ignorance.

Trying to correctly duplicate formulas keeping same cell range but adjusting date ranges

I'm trying to help someone with an Excel spreadsheet of sales figures. I hope this explanation is clear. She has a worksheet for each category of items she sells, such as clothing, shoes, furniture, &c. Each worksheet has a column, G, for Date Sold, and the data is in Date format.
On a summary worksheet, she wants to aggregate and analyze the data, and one thing she was doing manually was counting the number of sales of each category for each month (sometimes zero).
I helped her write a formula to pull the count from the clothing worksheet, for the month of March 2019 into a cell on the summary worksheet:
=COUNTIF($CLOTHING.G3:G502;">2/2019")-COUNTIF($CLOTHING.G3:G502;">=4/2019")
This correctly yields 5. Cool. But that is just one month, and we need twelve for each year, for multiple years, and we have six categories. So we'd rather not hard-code each formula every time we need a count.
When we tried to copy the formula into cells below (for April, May, etc), hoping it would adjust the dates, it wrongly adjusted the cell range to G4:G503. The cell range shouldn't change; the months should advance, but they did not change.
We've been trying different suggestions we found online, such as naming the range G3:G502 but it didn't like that. We got an error.
We both (obviously) have a limited knowledge of Excel. Please let me know what we're doing wrong OR if there is a better way to approach this, and how to do it step by step. Please ask any questions if my explanation is not clear.
Using your formula I would adjust it as follows:
=COUNTIF($CLOTHING.G$3:G$502;">="&DATE(2019;row(1:1);1))-COUNTIF($CLOTHING.G$3:G$502;">"&EOMONTH(DATE(2019;row(1:1);1),0))
Note the addition of the $ to the cell reference. This keeps either the column or row from change when a cell is copied.
Row(1:1) will return 1 in the first cell it it entered into and as it is copied down will increase by 1. Therefore it is important not to copied it down more than 12 rows from its initial entry point.
Note the year in the date is hard coded. Alternatively the year could be placed be place in a cell and a reference to that cell could be used in place of the hard coded year. That way in subsequent years, you would just change the value in the cell instead of changing your value in the hard coded formula.
Note this solution assumes January for the first cell and months following sequentially to December for the 12th cell.
I my system is configured to use , as separators instead of ; so it is possible I may have made a mistake with those in my edits.
Alternatively you could look at COUNTIFS. It is similar to COUNTIF but requires all entries to be TRUE for an entry to be counted.
=COUNTIFS($CLOTHING.G$3:G$502;">="&DATE(2019;row(1:1);1);$CLOTHING.G$3:G$502;">"&EOMONTH(DATE(2019;row(1:1);1),0))

Add hours from different sheets based on date

I have an Excel file where I have a few sheets. On one I keep track of my hours I work a the office. The other sheet is used to track the hours I spend travelling.
This is sheet1.
Date Hours
27/11 8
28/11 8
29/11 7
This is sheet2.
Date Hours
27/11 0
28/11 0
29/11 4
I would like to have a column on sheet1, that adds the hours depending on the dates. For example,
Date Total Hours
27/11 8
28/11 8
29/11 11
How would I go about doing this?
Assuming that your date column starts in A2, this should work:
=SUMIF(Sheet2!$A$2:$A$4,Sheet1!A2,Sheet2!$B$2:$B$4)+Sheet1!B2
The conventional solution is not to have the travel hours on a separate sheet in the first place (or if they are needed elsewhere to obtain them from the sheet1). When together with the office hours the data is more compact (e.g. the dates only entered once), so requires less storage space, the ‘picture’ provided by sheet1 ‘at a glance’ is more comprehensive (it may not be coincidence that the one day in the example showing travel time is also the one day with below average hours work at the office) – and the formula is simple, not requiring a question on SO, is easier to maintain, faster to process etc.
I would like to have a column on sheet1, that adds the hours depending on the dates.
Assuming consistency in layout (e.g. say Date is in A1 on both sheets), then copying sheet2 ColumnB into sheet1 ColumnC, inserting Total into sheet1 D1 and entering:
=B2+C2
in sheet1 D2 and copying down would appear to meet your requirement and have the other advantages mentioned, though I suspect not quite the solution you wanted. In your last example you do not show the Hours column that you already had in sheet1 and if this is part of your objective you might, after the above, just hide ColumnsB:C.

How to display rows that contain data present in several columns (Excel and/or Google Spreadsheet)

I've been searching for a solution to my problem for days and haven't had any luck. Maybe I simply can't manage to search for the right wording for this problem but hopefully somebody will understand me here.
I'm having difficulties displaying data that is present in several columns at the same time, in my case the data to be displayed are trading days for various stocks. As the trading days vary between stocks I would like to have a column that displays the dates present in all other columns to only see trading days in common for all stocks.
I apologize if I'm unclear as this is my first question here. If anyone could point me in the right direction I would greatly appreciate it.
Here's the google spreadsheet link so you can see what I mean by different amount of trading days. The idea is to have column A display dates which are present in columns B,F,J,N,R,V at the same time but not show the other ones.
https://docs.google.com/spreadsheets/d/19GsIAtEdWPGcBfNOPaeqNVB7QQNO-bOyg-dCZzDaGkQ/edit?usp=sharing
EDIT: To show the desired output I'm looking for, here's another example:
https://docs.google.com/spreadsheets/d/1jrIqaEzDPWcW4hkF2YdHq9XYIWjG8PhrewYrBHqEdVY/edit?usp=sharing
The dates are automatically pulled from google finance. As the various exchanges are open on different dates, each stock has a varying amount of open days in columns B-E.
What I'm trying to do is have a formula in Column A that checks all the other columns and returns the data (in this case the date) that appears in every other column, discarding the data that doesn't appear in all other columns. For example 3/9/2013 appears in all columns B-E therefore it is shown, however 12/09/2013 doesn't appear in column B therefore it isn't shown.
Cheers
your dates are in european (UK) style, ie: 31/12/2014 but your spreadsheet is saved as US standard. This will cause some dates to be stored as text, as they are considered invalid. Ti will also couse unexpected results if you try to do any calculations or comparisons using your data. Go to File -> Spreadsheet settings and under locale choose correct country.
Then select all date columns, and click format->number->date or click the 123v button on tool bar, and choose date.
to simplify your problem:
for a value to be repeated across all 6 columns, that value must appear in column B.
you therefore want column A to contain the value of the adjacent cell in column B, if that value also appears anywhere in column F,J,N,R and V.
to check if value of B4 appears in column F you can use COUNTIF function. If the result if >0, than value of B4 appears in column F. Repeat for all columns and combine to achieve the following formula (to go in cell A4) :
=if(countif(F:F,B4)*countif(J:J,B4)*countif(N:N,B4)*countif(R:R,B4)*countif(V:V,B4),B4,)
now copy this formula down, and only dates that appear in all columns will be displayed in column A.
Use IF and COUNTIF. I think this is what you are looking for.
IF(COUNTIF(B4:V4,B4)=6,B4,NA())

Count/If/Sum formula

I am using a spreadsheet to count sold items for several teams.
Rows: Individual Seller
In column A I have the specific team the seller belongs to.
In column B I have the amount of items that the seller sold.
In a separate row at the end of the document, I am trying to calculate the total number of items being sold from a specific group.
Can anyone help me write the code needed to return the total number of items sold for each specific team?
The image shows some sample data in A1:C13, and three different ways to sum the amounts by teams. There are many others ways. Of the three I recommend #Jerry’s suggestion of a PivotTable (E2:F6) because it is very easy to set up, very quick in operation and offers a great deal of versatility beyond merely summing amounts by team. For example if your data included dates of sales it could sort and group by week, month, year etc. The second version of it (E8:F14) shows a breakdown by Seller of the 20 total, but by the number of ‘sales’ (rows) rather than number of items sold.
The formula in D20 (copied down to D22) is:
=SUMIFS(B$2:B$19,A$2:A$19,A20)
However SUMIFS was not available as a standard MS Office function before Excel 2007, though SUMIF was, so in B20, also copied down to suit:
=SUMIF(A$2:A$19,A20,B$2:B$19)
SUMIFS allows more conditions than SUMIF, so for example can be changed in D20 to:
=SUMIFS(B$2:B$19,A$2:A$19,A20,C$2:C$19,"Seller1")
to obtain the amount of items comprising the two distinct ‘sales’ by Seller1 as shown by 2 in the lower PivotTable.
Since you are trying to calculate the total from a specific group the above may be more elaborate than your immediate requirement so a version that can be placed almost anywhere in your sheet (if as the example) and even copied around, replaces a variable with a fixed condition, which I have chosen to be teamB:
=SUMIF($A$2:$A$19,"teamB",$B$2:B$19)
and provided the formula is kept out of ColumnA might be further simplified by extending it to consider entire columns:
=SUMIF(A:A,"teamB",B:B)

Resources