Two Columns with Similar Data in Excel How to Match One Columnn and Return The New Data - excel

I have columns in excel
ORDER NUMBER Order Paid Date Order Total Order Date
A1=1 B1= jan 1 c1= $1 d1= Dec 1
A2=2 B2=jan 2 c2= $1 d2= Dec 1
A3=3 B3=jan 3 c3= $1 d3= Dec 1
Then I have another column
ORDER NUMBER Shipment Date
I1=1 J1= Jan 5
I2=2 J2= jan 6
I3=3 J3= jan 7
How do math the order number (I1) to the order number in A1 and add it to the next column so it would look like this
ORDER NUMBER Order Paid Date Order Total Order Date Shipment Date
A1=1 B1= jan 1 c1= $1 d1= Dec 1 E1= JAN 5
A2=2 B2=jan 2 c2= $1 d2= Dec 1 E1= JAN 6
A3=3 B3=jan 3 c3= $1 d3= Dec 1 E1= JAN 7
I have tried Vlookup =VLOOKUP(A2,$J$1:$K$14075,2,FALSE) with the proper columns but that doesnt work, is there any other formula that would?
Thanks so much I greatly appreciate all the responses.

You say proper columns but the sample data you provided says you have them in columns I and J?
I would use the following formula:
=VLOOKUP(A2,$I:$J,2,FALSE)
$I:$J covers the two columns completely.

You have your Order date and shipment date data in columns I & J, but are running your VLOOKUP in J&K - try changing the range to $I$1:$J$14075 and see if that helps you.

Related

How return substring of count for override for found december?

I have a spreadsheet that will always return varying row contents. So I need to search each row to find the january, february, march, april, may, june, july, etc content and extract the counts from that in the cell with substring. I'm not certain how to do this since the location in the row will always vary. Any ideas? I was thinking vlookup or index or match, or mid/search, but I'm not sure.
Example spreadsheet content, notice some rows have the overallCount and some have overrideCount, and a string like "overallCount 2022/12 35" is the complete cell value, where 2022 is the year, and 12 is the month:
result1 result2 result3 result4
overallCount 2023/01 11 overallCount 2022/12 35 overallCount 2022/01 12 overrideCount 2022/08 5
overallCount 2023/02 1 overallCount 2022/11 34 overrideCount 2022/02 9 overrideCount 2022/01 5
------ (3 rows) OverrideYearOrders overrideCount 2022/10 2 overallCount 2023/01 6
And the rows can have varying column numbers as well if there are more or less orders for each device.
I want to add a formula in result8 column or so, and search to the left of each row, and pull out the counts in columns for Jan, Feb, March, April, May, etc. I was thinking of something like this:
=VLOOKUP("overrideCount 2022/12",H6:AC8517,1,FALSE)
but it's not returning the count. It's returning #N/A
example per-row output on the right:
Overall Override
Jan2022 Feb March April May June July Aug Sept Oct Nov Dec Jan2023 Jan2022 Feb Mar ...
35 11 5
As you can see, not every month has a count that would be found in the row.
How would I pull those monthly counts for overall and override out to the right in each row?
Update*
This is the generated table per comment below:
result1
result2
result3
result4
result5
Output to right here Overall Jan2022
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
Override Jan2023
Override Jan2022
Feb
overallCount 2023/01 11
overallCount 2022/12 35
overallCount 2022/01 12
overrideCount 2022/01 5
35
11
5
overallCount 2023/02 1
overallCount 2022/11 34
overrideCount 2022/02 9
overrideCount 2022/01 5
34
5
9
------
(3 rows)
OverrideYearOrders
overrideCount 2022/10 2
overallCount 2023/01 6
6
Example output is shown to right in generated table above, and also example per-row output is given in this before this added update already.
FORMULA:
This formula will get you to where you want pending a couple changes.
Rename the column headers to represent the date you want to calculate for (1/1/2022, 2/1/2022, ...).
This formula requires every cell value to "search" to be of "overallCount yyyy/mm" or "overrideCount yyyy/mm"
format
Drag and drop the formula for as far as you need it (row and columns).
First formula, totaling overallCount (F2:s2)
=IF(SUMPRODUCT(--IFERROR(SEARCH("overallCount "&TEXT(F$1,"yyyy/mm"),$A2:$E2)>0,FALSE)*SUMPRODUCT(--IFERROR(RIGHT($A2:$E2,LEN($A2:$E2)-(FIND("overallCount "&TEXT(F$1,"yyyy/mm"),$A2:$E2)+20)),0)))>0,SUMPRODUCT(--IFERROR(SEARCH("overallCount "&TEXT(F$1,"yyyy/mm"),$A2:$E2)>0,FALSE)*SUMPRODUCT(--IFERROR(RIGHT($A2:$E2,LEN($A2:$E2)-(FIND("overallCount "&TEXT(F$1,"yyyy/mm"),$A2:$E2)+20)),0))),"")
Second formula, totalling overrideCount (R2:AG2)
=IF(SUMPRODUCT(--IFERROR(SEARCH("overrideCount "&TEXT(T$1,"yyyy/mm"),$A2:$E2)>0,FALSE)*SUMPRODUCT(--IFERROR(RIGHT($A2:$E2,LEN($A2:$E2)-(FIND("overrideCount "&TEXT(T$1,"yyyy/mm"),$A2:$E2)+21)),0)))>0,SUMPRODUCT(--IFERROR(SEARCH("overrideCount "&TEXT(T$1,"yyyy/mm"),$A2:$E2)>0,FALSE)*SUMPRODUCT(--IFERROR(RIGHT($A2:$E2,LEN($A2:$E2)-(FIND("overrideCount "&TEXT(T$1,"yyyy/mm"),$A2:$E2)+21)),0))),"")
EXPLANATION:
The formula is using the SUMPRODUCT function which multiplies the corresponding elements of the arrays and returns the sum of products.
The formula uses the SEARCH function to look for the occurrence
of the string in the cells using the format
"yyyy/mm", in the cells of the range A2:E2 and returns TRUE if
found, otherwise returns FALSE.
The formula uses the IFERROR function to check for errors and returns
0 if error is found.
The formula uses the RIGHT function and is used to extract the rightmost
part of the cell, starting from the position of the found string -20/-21 (calculation that takes advantage of the date in the column header plus its position in order to autofill). In short, it totals the number after the date.
EXAMPLE:
The following formula is the root formula that is just wrapped in an IF THEN statement to show empty cells instead of 0's. This formula is written assuming Cells A1:E1 are the 'results' headers, and starting at Cell F1 is the date start of your dates. (Jan22-Feb23 of each category)
SUMPRODUCT(--IFERROR(SEARCH("overallCount "&TEXT(F$1,"yyyy/mm"),$A2:$E2)>0,FALSE)*SUMPRODUCT(--IFERROR(RIGHT($A2:$E2,LEN($A2:$E2)-(FIND("overallCount "&TEXT(F$1,"yyyy/mm"),$A2:$E2)+20)),0)))

Sort Data by date with VBA

I will try to keep this as simple as possible and cause no confusion.
I have over 35,000 rows and 15 columns of data but I am going to provide a very simple case of what I am trying to do.
Basically, I want to sort my dates in column A in ascending order, but then also have the data corresponding to a date sorted to "follow" it to its new row location. I want this to be done using VBA code.
Simple Case
Raw Data
Column A Column B
Jan 5 15
Jan 3 45
Jan 1 7
Jan 10 12
Jan 7 30
Expected Sorted Data
Column A Column B
Jan 1 7
Jan 3 45
Jan 5 15
Jan 7 30
Jan 10 12
I have looked all over and can not find a good way to do this. Any and all help will be greatly appreciated. Thanks!

Calculate in Excel Sum of Days given 2 date ranges (Start date , End date), aggregate monthly

Please find the excel data.
Input format:
ID Begin Date End Date Comment
1 07/25/17 08/16/17 July 6 days, August 16 days
2 05/01/17 05/11/17 11 Days in May
3 07/10/17 07/16/17 6 days in July
Output format:
Jan-17 Feb-17 Mar-17 Apr-17 May-17 Jun-17 Jul-17 Aug-17..... Dec
11 12 16
How to get this aggregate at month level, given a range
Input Format:
Output format:
Are you including start date and end date because your results aren't consistent. If ID2 is 11 days then shouldn't ID3 be 7?
Assuming that you want to include both start date and end date then you can do that like this:
Put the first of each month in A8 copied across (formatted as mmm-yy) then use this array formula in A9
=SUM(TEXT(IF($B2:$B4="",0,IF($C2:$C4>EOMONTH(A8,0),EOMONTH(A8,0),$C2:$C4)-IF($B2:$B4<A8,A8,$B2:$B4)+1),"0;\0")+0)
confirm with CTRL+SHIFT+ENTER and copy across
This only counts rows that have both start and end date
See screenshot:

Excel formula to Count zeros only from Left to Right

I am currently using the following formula (i.e. =IF(A9<>"0";COUNTIF(A9:L9;"0");" ")) in a range "Jan to Dec" to get the number of zeros from left to right only and it is giving me 3 for 1st row, second & third rows as well. But what I want is, it should count zeros only from left to right (only in first and third cases). Only in second case it should not count zeros, because they are coming after some value, but it should count in 1st case and 3rd cases.
Can someone please help me with the formula?
Jan Feb Mar Apr May Jun Jul
0 0 0 5 10 15 20
10 15 20 25 0 0 0
50 0 0 0 30 35 40
Per comment conversation with OP vbalearner, assuming your data setup and desired results look something like this:
Then the formula in the cell and copied down is:
=IF(A9=0,IFERROR(MATCH(TRUE,INDEX(A9:L9>0,),0)-1,12),IF(B9=0,IFERROR(MATCH(TRUE,INDEX(B9:L9>0,),0)-1,12),0))
Shortened version:
=IF(OR(A9=0,B9=0),IFERROR(MATCH(TRUE,INDEX(IF(A9=0,A9:L9,B9:L9)>0,),0)-1,12),0)
With a helper row inserted at the top (may be hidden) with month numbers (1 for Jan etc) and assuming Jan is then in A2 please try:
=MIN(IF(A3:G3<>0;A$1:G$1))-1
entered with Ctrl+Shift+Enter and copied down to suit.

How to vlookup on 2 columns and return total value of another?

I've got a table in Excel which is structure like so:
Month Date Time ID Name Currency Value
Jan 07/01/14 5 1234567 Ted GBP 500
Jan 10/01/14 12 1234567 Ted GBP 723
Feb 23/02/14 6 9877654 John GBP 300
Feb 10/02/14 10 1234567 Ted GBP 333
What I need to do is write a formula which basically returns be the total of Value where ID and Month are equal to whatever the lookup values are. For example, using the above I would say:
Find the total of Value where Month equals Jan and ID equals 1234567.
The answer in this case would be 1223.
Ive just tried
=SUMIFS(INPUT!H:H,INPUT!D:D='TRANS BY MID'!B2,INPUT!A:A='TRANS BY MID'!C1)
INPUT!H:H is my ID column
INPUT!D:D='TRANS BY MID'!B2 is the ID I want to use
INPUT!A:A is the Month column
TRANS BY MID'!C1 is Jan
To provide a working solution I simplified your question into one sheet. The data appears like this:
You can link your other sheet to the values shown in column J.
The formula is now this:
=SUMIFS(G:G,D:D,J1,A:A,J2)
The result is shown in J7:

Resources