# Create specific excel table

**URL:** <https://discourse.julialang.org/t/create-specific-excel-table/88471>\
**Category:** New to Julia\
**Created:** [October 9, 2022, 9:42am UTC](https://discourse.julialang.org/t/create-specific-excel-table/88471 "2022-10-09T09:42:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emma456](https://avatars.discourse-cdn.com/v4/letter/e/db5fbb/32.png) [@Emma456](https://discourse.julialang.org/u/Emma456)\
**Post date:** [October 9, 2022, 9:42am UTC](https://discourse.julialang.org/t/create-specific-excel-table/88471/1 "2022-10-09T09:42:38Z")

</div>

My problem is assigning employees to offices.

I would like to post the solution in an excel file, in this form:

![image](https://global.discourse-cdn.com/julialang/original/3X/f/7/f7427c15d22761622f73d0d1d68cc54902998ffa.png)

At the moment my code looks like this:

```julia
XLSX.openxlsx("choix élèves julia.xlsx", mode="rw") do xf
    !XLSX.hassheet(xf, "ATTRIBUTION") && XLSX.addsheet!(xf, "ATTRIBUTION")
    sheet = xf["ATTRIBUTION"]
    sheet["A1", dim=2] = collect(1:4)

    for j in 1
        sheet[j+1,1] = string("Sujet ",j,":") #string pour mettre plusieurs éléments dans une même case      
        for i in 1:e, k in 1:e
                if JuMP.value.(x[i,j])==1
                    sheet[j+1,2] = i
                    sum(x[i,j] for i in 1:e)=k
                end
            end
        end
    end

```

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [October 14, 2022, 2:04am UTC](https://discourse.julialang.org/t/create-specific-excel-table/88471/2 "2022-10-14T02:04:38Z")

</div>

Also asked here: [Sum of JuMP.value - #4 by Emma456](https://discourse.julialang.org/t/sum-of-jump-value/88673/4). Let’s continue the discussion in that thread.
