MrDB4Excel
Active Member
- Joined
- Jan 29, 2004
- Messages
- 348
- Office Version
- 2013
- Platform
- Windows
I spent a great deal of time today looking through several options of VLOOKUP, HLOOKUP, XLOOKUP, and other Index and Match scenarios but could not seem to get things working correctly. I always ended with the result being either from the same row or of the type #VALUE! error.
If exist in a column range then copy from a row range the values in cells adjacent to the cell in which the value from the column range was found.
For example, in column “C” I need to find, if it exists, a value, in this case, this value will always be in a number format in column “C” such that the number format is always two digits to the left of the decimal and three digits to the right of the decimal: 00.000.
If the number exists in column “C” then I need to get the values in the row to the right of the cell but one row down. So for example, I need to find in column “C”, the value 20.943 (in the attached Xl2bb Mini Sheet 20.943 is in cell C16). To the right of cell C16 and one row down (row 17), you see a series of numbers from column “D” through to column “N” and these numbers are always of the format one digit to the left of the decimal and three digits to the right of the decimal: 0.000.
So then, if the number searched for does exist, then the formula would get the values in cells D-row# through to and including N-row#; in the example described above it would be D17 to N17. At this point is a simple matter of me copying these numbers to the other sheet called ForTab in the location beginning at cell N6 and thus would paste through to X6.
How would the formula know what number to see if it exists in column “C”? Good question. The simple answer is the formula looks at cell AJ2 on sheet DailyRate1Apr2023-31Mar2024. AJ2 is equal to cell L17 on sheet ForTab.
To make this a bit more tricky I would want the basic if exist formula to exist on sheet ForTab, thus picking it would either jump to sheet DailyRate1Apr2023-31Mar2024 and in the same breath get the cells D-row# through to and including N-row#; from which I would, of course, do a simple copy and paste back to ForTab—or it would give a message something akin to value does not exist. At this point, I would quickly know to run the numbers on Fortissimo’s website to get exchange rate values.
Side note: this workbook, BogusFortissimoTabulation2023.xlsx, was set up with bogus data but essentially is the same as the original workbook FortissimoTabulation2023.xlsx except the original has confidential data and several more sheets. Also, note that I have the XLOOKUP addin I am using for my Excel 2013 thus XLOOKUP works very well.
If exist in a column range then copy from a row range the values in cells adjacent to the cell in which the value from the column range was found.
For example, in column “C” I need to find, if it exists, a value, in this case, this value will always be in a number format in column “C” such that the number format is always two digits to the left of the decimal and three digits to the right of the decimal: 00.000.
If the number exists in column “C” then I need to get the values in the row to the right of the cell but one row down. So for example, I need to find in column “C”, the value 20.943 (in the attached Xl2bb Mini Sheet 20.943 is in cell C16). To the right of cell C16 and one row down (row 17), you see a series of numbers from column “D” through to column “N” and these numbers are always of the format one digit to the left of the decimal and three digits to the right of the decimal: 0.000.
So then, if the number searched for does exist, then the formula would get the values in cells D-row# through to and including N-row#; in the example described above it would be D17 to N17. At this point is a simple matter of me copying these numbers to the other sheet called ForTab in the location beginning at cell N6 and thus would paste through to X6.
How would the formula know what number to see if it exists in column “C”? Good question. The simple answer is the formula looks at cell AJ2 on sheet DailyRate1Apr2023-31Mar2024. AJ2 is equal to cell L17 on sheet ForTab.
To make this a bit more tricky I would want the basic if exist formula to exist on sheet ForTab, thus picking it would either jump to sheet DailyRate1Apr2023-31Mar2024 and in the same breath get the cells D-row# through to and including N-row#; from which I would, of course, do a simple copy and paste back to ForTab—or it would give a message something akin to value does not exist. At this point, I would quickly know to run the numbers on Fortissimo’s website to get exchange rate values.
Side note: this workbook, BogusFortissimoTabulation2023.xlsx, was set up with bogus data but essentially is the same as the original workbook FortissimoTabulation2023.xlsx except the original has confidential data and several more sheets. Also, note that I have the XLOOKUP addin I am using for my Excel 2013 thus XLOOKUP works very well.
BogusFortissimoTabulation2023.xlsx | |||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | AL | AM | AN | AO | AP | AQ | AR | AS | AT | AU | |||
1 | Beginning With April 1, 2023 | $1,000 | $2,000 | $3,000 | $4,000 | $5,000 | $6,000 | $7,000 | $8,000 | $9,000 | $10,000 | $11,000 | $12,000 | Extra Dates Per Specific Rate | 16 | 18 | 18 | B Col Count | Thu-01 June 2023 | #N/A | 1st Date/Time | 2nd Date/Time | 3rd Date/Time | =TEXT(?? | =TEXT(?? | =TEXT(?? | |||||||||||||||||||||||
2 | April 2023 | May 2023 | June 2023 | July 2023 | August 2023 | September 2023 | October 2023 | November 2023 | December 2023 | January 2024 | February 2024 | March 2024 | Min ððð | 64,923.30 Kč | 3,100 | $B$18 | 16 | $O$16 | 16 | #N/A | 21.508 | D | E | F | G | H | I | J | K | L | M | N | |||||||||||||||||
3 | Max ððð | 66,417.50 Kč | 3,200 | 20 | $O$6 | 6 | |||||||||||||||||||||||||||||||||||||||||||
4 | 7:47:58 | Sat-01 April 2023 | 21.357 | 21.361 | 21.366 | 21.370 | 21.374 | 21.378 | 21.378 | 21.378 | 21.378 | 21.378 | 21.378 | 21.378 | 66,206.70 Kč | MDL | 1 | 3,100 | Apr 02, 2023 06:23:06 Apr 03, 2023 06:44:02 | 1 | Apr 02, 2023 06:23:06 | Apr 03, 2023 06:44:02 | Apr 02, 2023 06:23:06 | Apr 03, 2023 06:44:02 | January | 2023 | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | |||||||||||
5 | 0.004 | 0.005 | 0.004 | 0.004 | 0.004 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0 | February | 2024 | |||||||||||||||||||||||||||||||||||
6 | 5:59:11 | Tue-04 April 2023 | 21.425 | 21.430 | 21.434 | 21.438 | 21.440 | 21.445 | 21.447 | 21.447 | 21.447 | 21.447 | 21.447 | 21.447 | 66,417.50 Kč | MDL | 1 | 3,100 | Feb 06, 2023 08:26:24 May 23, 2023 07:12:42 | 2 | Feb 06, 2023 08:26:24 | May 23, 2023 07:12:42 | Feb 06, 2023 08:26:24 | May 23, 2023 07:12:42 | March | ||||||||||||||||||||||||
7 | 0.005 | 0.004 | 0.004 | 0.002 | 0.005 | 0.002 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0 | April | ||||||||||||||||||||||||||||||||||||
8 | 12:32:54 | Wed-05 April 2023 | 21.162 | 21.167 | 21.171 | 21.175 | 21.179 | 21.183 | 21.183 | 21.183 | 21.183 | 21.183 | 21.183 | 21.183 | 65,602.20 Kč | 1 | 3,100 | Apr 06, 2023 07:29:06 | 3 | May | |||||||||||||||||||||||||||||
9 | 0.005 | 0.004 | 0.004 | 0.004 | 0.004 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0 | June | ||||||||||||||||||||||||||||||||||||
10 | 7:17:47 | Tue-25 April 2023 | 21.075 | 21.079 | 21.083 | 21.088 | 21.092 | 21.096 | 21.096 | 21.096 | 21.096 | 21.096 | 21.096 | 21.096 | 65,332.50 Kč | 0 | 3,100 | 13 | #REF! | ||||||||||||||||||||||||||||||
11 | 0.004 | 0.004 | 0.005 | 0.004 | 0.004 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0 | January 2024 | ||||||||||||||||||||||||||||||||||||
12 | 7:19:25 | Wed-26 April 2023 | 20.948 | 20.953 | 20.957 | 20.961 | 20.965 | 20.969 | 20.969 | 20.969 | 20.969 | 20.969 | 20.969 | 20.969 | 64,938.80 Kč | 1 | 3,100 | 14 | February 2024 | ||||||||||||||||||||||||||||||
13 | 0.005 | 0.004 | 0.004 | 0.004 | 0.004 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0 | March 2024 | ||||||||||||||||||||||||||||||||||||
14 | 6:41:25 | Thu-27 April 2023 | 21.007 | 21.011 | 21.015 | 21.019 | 21.023 | 21.028 | 21.028 | 21.028 | 21.028 | 21.028 | 21.028 | 21.028 | 65,121.70 Kč | 1 | 3,100 | 15 | |||||||||||||||||||||||||||||||
15 | 0.004 | 0.004 | 0.004 | 0.004 | 0.005 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0 | |||||||||||||||||||||||||||||||||||||
16 | 7:51:15 | Fri-28 April 2023 | 20.943 | 20.948 | 20.952 | 20.956 | 20.960 | 20.964 | 20.964 | 20.964 | 20.964 | 20.964 | 20.964 | 20.964 | 64,923.30 Kč | 1 | 3,100 | 16 | |||||||||||||||||||||||||||||||
17 | 0.005 | 0.004 | 0.004 | 0.004 | 0.004 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0 | |||||||||||||||||||||||||||||||||||||
DailyRate1Apr2023-31Mar2024 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C1 | C1 | =ForTab!$M$1 |
D1 | D1 | =ForTab!$N$1 |
E1 | E1 | =ForTab!$O$1 |
F1 | F1 | =ForTab!$P$1 |
G1 | G1 | =ForTab!$Q$1 |
H1 | H1 | =ForTab!$R$1 |
I1 | I1 | =ForTab!$S$1 |
J1 | J1 | =ForTab!$T$1 |
K1 | K1 | =ForTab!$U$1 |
L1 | L1 | =ForTab!$V$1 |
M1 | M1 | =ForTab!$W$1 |
N1 | N1 | =ForTab!$X$1 |
U1 | U1 | =EXTRACTNUMBERS(X2,TRUE) |
V1 | V1 | =SUM(U1+2) |
W1 | W1 | =EXTRACTNUMBERS(V1) |
Z1 | Z1 | =XLOOKUP(Y1,$B$4:$B$17,$C$4:$C$17,0) |
W2 | W2 | =ADDRESS(W1,2) |
X2 | X2 | =COUNTA(E:E) |
Y2 | Y2 | =CELL("address",INDEX(O:O,MATCH(MIN(O:O),O:O,0))) |
Z2:Z3 | Z2 | =RIGHT(Y2,LEN(Y2)-FIND(CHAR(160),SUBSTITUTE(Y2,"$",CHAR(160),2))) |
Y3 | Y3 | =CELL("address",INDEX(O:O,MATCH(MAX(O:O),O:O,0))) |
AH2 | AH2 | =CELL("Address",XLOOKUP($AJ$4,$C$4:$C$61,$D$4:$D$61)) |
AJ2 | AJ2 | =ForTab!L17 |
P2 | P2 | =MIN($O$4:$O$17) |
P3 | P3 | =MAX($O$4:$O$17) |
O4,O16,O14,O12,O10,O8,O6 | O4 | =IFERROR(IF(SUM(C4*R4)=0,"",(SUM(C4*R4))),"") |
R4:R17 | R4 | =IF(YEAR(B4)=2023,$R$2,IF(YEAR(B4)=2024,$R$3,"")) |
S4,S6 | S4 | =AD4&CHAR(10)&AE4 |
AD6:AE6,AD4:AE4 | AD4 | =TEXT(AA4,"mmm dd, yyyy hh:mm:ss") |
AJ4:AU4 | AJ4 | =XLOOKUP($AJ$2,$C$4:$C$61,$C$4:$N$61) |
Q11:Q17,Q5:Q9 | Q5 | =MOD(ROWS(Q$2:Q3),2) |
Q10 | Q10 | =MOD(ROWS(Q$2:Q9),2) |
AG10 | AG10 | =#REF!&" "&$AH$4 |
AG11:AG13 | AG11 | =AG4&" "&$AH$5 |
Press CTRL+SHIFT+ENTER to enter array formulas. |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
C4 | Expression | =$Q4=0 | text | NO |
C5:N6,D4:N4,A4:B6,A7:N17 | Expression | =$Q4=0 | text | NO |
Cell Formulas | ||
---|---|---|
Range | Formula | |
M1 | M1 | =F2 |
N1 | N1 | =F3 |
O1 | O1 | =F4 |
P1 | P1 | =F5 |
Q1 | Q1 | =F6 |
R1 | R1 | =F7 |
S1 | S1 | =F8 |
T1 | T1 | =F9 |
U1 | U1 | =F10 |
V1 | V1 | =F11 |
W1 | W1 | =F12 |
X1 | X1 | =F13 |
M2 | M2 | =D2 |
N2 | N2 | =D3 |
O2 | O2 | =D4 |
P2 | P2 | =D5 |
Q2 | Q2 | =D6 |
R2 | R2 | =D7 |
S2 | S2 | =D8 |
T2 | T2 | =D9 |
U2 | U2 | =D10 |
V2 | V2 | =D11 |
W2 | W2 | =D12 |
X2 | X2 | =D13 |
M3 | M3 | =$F2 |
N3 | N3 | =$F3 |
O3 | O3 | =$F4 |
P3 | P3 | =$F5 |
Q3 | Q3 | =$F6 |
R3 | R3 | =$F7 |
S3 | S3 | =$F8 |
T3 | T3 | =$F9 |
U3 | U3 | =$F10 |
V3 | V3 | =$F11 |
W3 | W3 | =$F12 |
X3 | X3 | =$F13 |
F2,F25 | F2 | =H2 |
G2 | G2 | =L17 |
F26:F36,F3:F13 | F3 | =SUM(F2+H3) |
G3 | G3 | =SUM(G2+N$6) |
G4 | G4 | =SUM(G3+O$6) |
G5 | G5 | =SUM(G4+P$6) |
G6 | G6 | =SUM(G5+Q$6) |
G7 | G7 | =SUM(G6+R$6) |
G8 | G8 | =SUM(G7+S$6) |
G9 | G9 | =SUM(G8+T$6) |
G10 | G10 | =SUM(G9+U$6) |
G11 | G11 | =SUM(G10+V$6) |
G12 | G12 | =SUM(G11+W$6) |
G13 | G13 | =SUM(G12+X$6) |
I2:I3 | I2 | =SUM(E2*H2) |
Y4 | Y4 | ='F:\Finances\CSOB\2023\[CurrencyConversionRatesWebQuery2023.xlsm]Current Rates'!$J$12 |
K5 | K5 | =NOW()-TODAY() |
L5 | L5 | =F17 |
M5 | M5 | =$G2 |
N5 | N5 | =$G3 |
O5 | O5 | =$G4 |
P5 | P5 | =$G5 |
Q5 | Q5 | =$G6 |
R5 | R5 | =$G7 |
S5 | S5 | =$G8 |
T5 | T5 | =$G9 |
U5 | U5 | =$G10 |
V5 | V5 | =$G11 |
W5 | W5 | =$G12 |
X5 | X5 | =$G13 |
Y5 | Y5 | =#REF! |
L11,N21 | L11 | =NOW() |
D2:D13 | D2 | =E25 |
G17,D22,G21 | G17 | =YEAR(TODAY()) |
H17,H21 | H17 | =MONTH(TODAY()) |
I17,I21 | I17 | =DAY(TODAY()) |
J17 | J17 | ="$"&H2 |
F17,F21 | F17 | =DATE(G17,H17,I17) |
F18 | F18 | =TEXT(DATE(H17,H17,1),"MMMM") |
M21 | M21 | =TODAY() |
O21 | O21 | =TEXT(M21,"dddd, mmmm, yyyy ")&TEXT(N21,"hh:mm:ss") |
H22 | H22 | =MONTH(F22) |
D23 | D23 | =YEAR(TODAY())+1 |
D24 | D24 | =YEAR(TODAY())+2 |
F20 | F20 | =VLOOKUP(F23,$B$2:$G$13,6,0) |
F22 | F22 | =EDATE(F21,1) |
F23:F24 | F23 | =TEXT(DATE(H21,H21,1),"MMMM") |
E25:E33 | E25 | =D25&"-"&$D$22 |
G25:G36 | G25 | =G2 |
E34:E36 | E34 | =D34&"-"&$D$23 |
L24 | L24 | =DATE(YEAR($L$23)+1,MONTH($L$23),DAY($L$23)) |
L25 | L25 | =IF(L26=H22,F24,F23) |
L26 | L26 | =IF(I17>10,H22,H21) |
L28 | L28 | =IF(L29=H21,F23,F24) |
L29 | L29 | =IF(I17<10,H22,H21) |
J25:J36 | J25 | =IF(I2=0,"",I2) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
N6:X6 | Cell Value | contains "Zero" | text | NO |