I need a quick simple formula for excel data. I want to copy certain data from each "service" line into a specific "service" column (will be in another file, but for convenience I put in this example in the same sheet).
So I need a formula with VLOOKUP or IF or both, I don't know exactly how, but to do the following:
- search for the ID number in column A
- search for the "service name" in column B
- copy the data (column C) into each service column accordingly.
ID | Service | Data | ||||||
---|---|---|---|---|---|---|---|---|
1234 | AAA | 4032 | AAA | BBB | CCC | DDD | EEE | |
1234 | BBB | 145 | 1234 | vlookup or IF ? | vlookup or IF ? | vlookup or IF ? | vlookup or IF ? | vlookup or IF ? |
1234 | CCC | 136,5 | ||||||
1234 | DDD | 48 | ||||||
1234 | EEE | 56 |
3,000 sats paid
=IFERROR(VLOOKUP($F2,FILTER($A$2:$C$11,G$1=$B$2:$B$11),3,FALSE),"")
$F2
with the column that containsID
in the wide table$A$2:$C$11
with the full range of your original tableG$1
with the column that contains the service code column heading in the wide table$B$2:$B$11
with the original service code columnID, Service
pair in the original data appears at most once.)Microsoft® Excel® for Microsoft 365 MSO (Version 2411 Build 16.0.18227.20082) 64-bit
$F2
but your ID column is onE
so it should be$E2
. Also, theG$1=...
part should sayF
. Essentially, your second table is one column shifted to the left from my example.$
sign means that the formula will "stick" to that column (or row) when dragging a formula along or down.$A:$D
)A$1:C$6
could be a range in the same sheet, a different tab, or a different sheet.